I have an application which is running symfony + wordpress on my development server. The development server is running on the lowest plan at webfaction, which is a shared server that gives me 80MB of RAM.

The site is running apache through mod_fcgid.

The application runs pretty snappy for now on that server.

I ran an ab benchmark:

ab -n 1000 -c 10 http://devserver/

and got 6.33 request/s, which is not the greatest, but the site does seem to be fast enough.

I moved the site to a staging server, which is a VPS with the following specs:

> sysctl hw.physmem
> sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
hw.machine: i386
hw.model: Intel(R) Xeon(TM) CPU 3.20GHz
hw.ncpu: 2
hw.machine_arch: i386

So it seems like a pretty beefy machine. I'm running apache+mod_php, basically out of the box. Sometimes there is a noticeable difference in speed. Sometimes there is incredibly noticeable difference in speed.

I tried the same ab benchmark, and it only got to 20 before it decided that was too much.

Every once in a while, the speed is acceptable, but then I go back to the dev server, and I'm reminded how fast it can run.

Any reason why the app would be running so much slower on a superior box?

  • Is there a particular number you can get from the staging server (like the ab benchmark you got on your development machine?) Are the operating systems different, or the versions of php and apache? – Sagar Aug 24 '10 at 22:15
  • I can't get a number...it doesn't complete the test. Apache and PHP are the same version – blockhead Aug 24 '10 at 22:25
  • 2
    VPS servers are often finicky. There may be limits on the amount of peak CPU you can use, or memory, or bandwidth throttling. The machines are often IO bound. You might just be sharing a server with a bunch of other users. Virtualization is good for many things... raw performance is not usually one of them. Since you say it is variable, my guess is your host has you crowded onto a box with other heavy users. – mfarver Aug 24 '10 at 23:21
  • mfarver's comment is probably right on the mark. Also, try to compare the settings in the CMS, php, webserver and database, it could be your VPS is simply not configured correctly. – Joris Aug 25 '10 at 4:44
  • 1
    You have only a slice of that machine, and I would not describe it as very modern or beefy (seems to be a two processor NetBurst architecture). – kmarsh Aug 25 '10 at 12:38

if its wordpress, try looking not at the server but at the database. you may need to implement a caching layer like memcached


I recommend to try nginx + php-fpm configuration
The setup is easy to implement and you may observe a dramatic performance gain (in all regards, speed and resources, easiness of configuration and maintenance).

See nginx and more precisely the setting of nginx+phpfpm.

  • I tried php-fpm, but when I started php-fpm, the machine, almost, immediately ran out of memory. I got scared off and didn't want to try again. – blockhead Aug 25 '10 at 1:34
  • You may try a newer version of php-fpm. Also, please have a look to nginxphp.wordpress.com/2010/01/28/php-fpm-apc-disk-io (for the RAM part). – Ring Ø Aug 25 '10 at 1:47
  • Newer than the one that ships with php 5.3.3? Does that require patching php, or was the php patch for older versions only because php itself didn't support fpm? – blockhead Aug 25 '10 at 2:35
  • PHP 5.3.3 is new. Did you have a look at the php-fpm options (link) ? – Ring Ø Aug 25 '10 at 3:53
  • Yes...that's how I installed fpm...with the --enable-fpm option. – blockhead Aug 25 '10 at 10:55

I'm not familiar with Wordpress, but even your dev server performance seems rather poor to me. At a guess I'd say the bottleneck is probably the amount of memory. (but why on earth pay for hosting of a development machine?).

As for the staging server. No idea. What's 'free' reporting? What's the load? CPU usage? How is apache configured? How long does it take to resolve a single request? For performance this bad, it suggests that the system is hanging around waiting for DNS queries or socket timeouts. What does netstat report? iotop?

A full explanation of how to investigate and resolve performance problems on Apache and PHP will fill a very large book - so you may not find a definitive answer here on SF.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.