PHP Optimization and Scalability – Slides and Source
I gave a talk for the San Jose PHP meetup last night on PHP scalability and optimization. Everything from good code (and bad code) to infrastructure (including Cloud Hosting with Aptana) was covered.
If you have any questions, feel free to post them in the comments, I’ll respond to them as soon as I can!
Enjoy.














Phil
Oct 31 '08 at 6:27 pm
I was delighted to learn that SPL is compiled by default in PHP5 now. I hadn’t checked on that one in a long time…
Instead of include_once and require_once, do you recommend simply using include and require?
Also, with autoload (_autoload or spl method), that stuff is not loaded twice, because those are only called the first time the class file is needed, right?
Great slides. Wish I could have caught your presentation. Congrats, my young friend!
Phil
Oct 31 '08 at 6:37 pm
Oh, and what’s the 2nd false argument to spl_autoload_register. It’s not documented? Namespace?
Phil
Oct 31 '08 at 6:50 pm
I’ve been toying with the idea of using a singleton for my database class… or one for read and another for right… or a singleton with somekind of factory init which passes back the db handle for read or write depending on an arg… Thoughts? I use a singleton for my error messages class, so the model/validate methods can write to it, the controller can check it, and the view can show the errors easily… It’s like globals through a back-door, but right now I’m saying global $DB_WRITE anyway…
Brant
Feb 2 '09 at 10:29 pm
Installing APC isn’t as easy as it sounds….
checking whether the C compiler works… configure: error: cannot run C compiled programs.
If you meant to cross compile, use `–host’.
See `config.log’ for more details.
ERROR: `/root/tmp/pear/APC/configure –with-apxs’ failed
Ian
Feb 2 '09 at 10:54 pm
Common gotcha, what you’re missing there is the apache developer libraries. What distro are you on? For example, on Ubuntu you can install those using “sudo apt-get install apache2-threaded-dev”