Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have just finished setting up my own VPS with the following specs: 2 Ghz single core CPU and 1 GB RAM.

I'm using nginx for my webserver needs. I installed Ruby on Rails, Phusion Passenger, mysql and php5-fpm.

I uploaded a Wordpress blog and am experiencing slow responsiveness: http://cl.ly/6Hks. CPU load is about 10-20% when requesting a page.

When I look at ps aux I see the following output:

root       896  0.0  0.3  40916  4080 ?        Ss   10:49   0:00 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   897  0.1  3.2  66488 33260 ?        S    10:49   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   898  0.1  2.0  54660 21084 ?        S    10:49   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   899  0.1  3.1  66468 32040 ?        S    10:49   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   900  0.1  3.1  66492 32196 ?        S    10:49   0:05 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   901  0.1  3.1  66984 32300 ?        S    10:49   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   902  0.1  3.2  68040 33648 ?        S    10:49   0:05 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   903  0.1  3.3  68364 33924 ?        S    10:49   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   904  0.1  3.3  68348 34088 ?        S    10:49   0:05 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   905  0.1  3.3  68572 34140 ?        S    10:49   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf
www-data   906  0.1  3.1  66500 32068 ?        S    10:49   0:04 /usr/bin/php5-fpm --fpm-config /etc/php5/fpm/php5-fpm.conf

Is it normal to have that many php5-fpm processes?

Also, when I execute a traceroute to a static page on the domain it gets executed very quickly, but when I traceroute the wordpress blog the output is like this:

 1  10.15.206.1 (10.15.206.1)  8.832 ms  9.044 ms  19.764 ms
 2  p7001.net.upc.nl (212.142.7.1)  22.976 ms  10.605 ms  12.005 ms
 3  84.116.244.21 (84.116.244.21)  15.661 ms  14.731 ms  15.406 ms
 4  nl-ams04a-ri2-xe-9-1-0.aorta.net (84.116.130.218)  16.405 ms
    nl-ams04a-ri2-xe-9-0-0.aorta.net (84.116.130.170)  27.288 ms
    nl-ams04a-ri2-xe-2-3-0.aorta.net (84.116.134.89)  13.824 ms
 5  te7-1-10g.ar2.ams1.gblx.net (64.212.107.49)  15.009 ms
    208.178.58.193 (208.178.58.193)  14.877 ms  15.392 ms
 6  nominum.port-c2.552.406.ar4.lon3.gblx.net (64.210.69.250)  26.768 ms  24.410 ms  21.830 ms
 7  81.200.66.253 (81.200.66.253)  27.068 ms  23.849 ms  24.113 ms
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * *^C

Eventually I just exit the process because there's no end to it.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

First off, there's no such a thing as traceroute to a static/dynamic page. It's done on a host level. So unless you're using different servers for hosting static content and dynamic pages, traceroute won't be really helpful in that case.

As to the number of spawned php processes - this is entirely configurable and should be balanced between resources you have and the load you expect to have. The thing is you want as many processes as you can handle (to serve multiple concurrent users without waiting in queue), but at the same time don't want to deplete your memory completely. If your server starts swapping the performance will degrade severely.

You can try diagnosing this situation a bit more by checking your current memory usage (free -m or top) and verifying if you're not hitting some limit here.

That said, I don't know what your statistic is, is this 536ms request time for the main page only? It may not be brilliant, but it's not that bad either. Try comparing this with some static pages and other PHP applications to see where the problem lies. WordPress without caching may not be the fastest under the sun, but you can try optimizing things later on if you know what's causing the problem.

share|improve this answer
    
Memory usage is around 200MB. Still lots left so there should be no swapping. 536ms request time is for every page. –  Bram Jetten Apr 27 '11 at 11:40
    
Ah, I phrased it wrong. I mean is this request time for the PHP generated page only or all CSS / JS requests too? And what times do you get for static HTML and some Hello World in PHP? –  Karol Piczak Apr 27 '11 at 11:44
    
No it's not for CSS/JS requests. Static HTML pages: ±7ms. Simple hello world in PHP: ±15ms. Does this mean Wordpress is just really that awful? –  Bram Jetten Apr 27 '11 at 12:08
    
It seems indeed that your server is fine, and WordPress is your bottleneck. But I wouldn't call it awful. Just that it has some overhead. It's functional though. My WordPress blog has page generation times around 300ms, SilverStripe installation somewhere in 500ms range, and some simple sites on a streamlined in-house CMS get 100ms (all without caching). It's all a matter of how much processing/queries you do. –  Karol Piczak Apr 27 '11 at 12:34
    
You can have a look in bit.ly/2s0ILr and bit.ly/gKYpq1 and try profiling/caching a bit. Add to that some opcode caching (bit.ly/f5HITG) and you should be fine. As long as you can keep the generation time you have and serve unexpected guests inflow from cache there shouldn't be a real problem. –  Karol Piczak Apr 27 '11 at 12:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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