April 19, 2005

PHP Performance Issues

I have been using pre-built PHP applications like phpBB and WordPress and MediaWiki and with the last 2 I seem to have real performance problems. I have gone through as much documentation as I can find so that I can learn to better tune my PHP environment but so far I have had only marginal improvements. On the MyMilwaukee.com Wiki I find the pages are extremely slow. And the MHC Blog is also slow.

Last night I compiled Apache and mod_php with GCC optimizations as well as compiling mod_php into Apache as a static module instead of a shared module. That is supposed to provide at least a 20% performance improvement, but it is still not enough. Another site running phpBB is actually quite responsive and it is not clear what the difference could be.

I know the blog and wiki both use mod_rewrite to use more readable URLs, but I would not attribute all of the poor performance to just that one aspect. I have tweaked the Apache settings and php.ini settings as well.

The server is running FreeBSD 4.10 and it is a fairly capable server. I have also run applications like PHP-Nuke and Mantis Bug Tracker on Windows and they also have performance issues. I thought PHP was supposed to be fast. Could it be these specific applications are just bloated dogs? What can I do to make them faster?

I run everything against a MySQL 4.x server and have turned on Gzip compression which has helped a little. Statically compiling mod_php into Apache has seemed to help, but all of those changes have not brought it under 1 second which is my goal.


Posted by brennan at April 19, 2005 12:10 PM | TrackBack
Comments

If you are using (and want to stick with) Wordpress, I would advise you to WP-Cache: http://mnm.uib.es/gallir/posts/2005/03/12/178/

For cache-hits this really speeds things up.

For phpBB there is a pinned thread in the support forum on how to speed things up for larger forums. My first advice would be to install Xore's eXtreme Style Mods - nevermind the funky name - lots of people ran tests and it is the fastest templating caching (and has some nice additional functions, too).
http://www.phpbb.com/phpBB/viewtopic.php?t=125251

All software you named alo uses mysql, are you sure it configured properly?

Since you are running your own server, you may want to try out lighttpd and php through fastcgi. This is a lot faster and less intense on the server than apache. I even heard of people having good results while still using apache to proxy only certain things over. Here is a recent happy user story:
http://weblog.textdrive.com/article/44/taking-a-full-frontal-slashdot-lighttpdly

Good luck.

Posted by: Sencer at April 19, 2005 05:15 PM
Post a comment

Comment Rules

Express your opinions and provide feedback, but abide by the following guidelines:

  1. Use language appropriate to civil conversation. Profanity is not acceptable.
  2. Innuendo is not allowed. If you have a point, make it clearly.
  3. Insults towards the site author or the author of a comment will not be tolerated. The point is to provide a healthy exchange of viewpoints.
  4. Comments must pertain to the topic of the blog entry.

Comments which do not abide by the rules will be deleted.










Remember personal info?







[ Home ]