2

I'm facing an issue here and after four days of looking around I decided to ask for some help here, after all a million heads can think a lot better than one.

I have a Ubuntu 14.04 server setup with NGINX, HHVM, PHP5-FPM (as a backup), Percona MySQL, Memcached (which will be replaced by Redis). I have fastcgi_cache setup for WordPress and object caching done over memcached. All cool and dandy in theory, but not in practice.

This is a RamNode OpenVZ SSD VPS with 2GB of RAM and an Intel Xeon E5 with two cores for my VPS.

Running Blitz.io on it the server is getting absolutely murdered by the two NGINX worker processes, which each one using 100% CPU according to top and htop. I usually run with the following pattern:

--pattern 999-1000:60 https://www.geeksune.com/blog/hello-world/

That makes makes CPU go to the roof and according to Blitz.io this is the result of that:

135 HITS WITH 57,734 ERRORS & 234 TIMEOUTS

Obviously that isn't good. RAM usage stay under 250MB all the time and it seems that all those requests from Blitz.io are hitting the cache, as seen here:

54.232.204.19 - HIT [23/Nov/2014:19:06:32 -0200] "GET / HTTP/1.1" 200 7632 "-" "blitz.io; [email protected]"

Notice the HIT at the start. I set a new log format and added $upstream_cache_status to it.

A similar setup on the same machine works just fine with Blitz.io, so there is definitely something wrong with my NGINX setup and it seems related to fastcgi_cache. I have the same results every time, even with just PHP5-FPM with Zend.

Does anyone have a clue about what is happening? My configuration files look like this:

Thanks in advance.

:)

5
  • 1
    Without showing your config it's going to be rather difficult to say much. However a concurrency test of a 1000 concurrent users with no warm up, to a 2 core vps with 2GB RAM running wordpress (yes, yes - cache etc.) sounds highly unlikely to succeed. Why not ramp up to 1000 and simply see at what point the errors start - i.e. how many concurrent users the setup can actually handle and go from there? A similar setup on the same machine works just fine How similar? Nobody should be guessing what your setup/config is.
    – AD7six
    Nov 25, 2014 at 17:58
  • @AD7six You are correct, sorry about that. I added the necessary files. As for how similar, it's basically the same but running Ubuntu 12.04 instead of 14.04. It also has other softwares running, while this one is basically running only those softwares. Nov 25, 2014 at 18:12
  • Replicated this setup on another server, this time with a quad-core CPU and using KVM. Same issue, all cores end up using 100% of the server CPU. Nov 26, 2014 at 18:47
  • @JulianFernandes having the same issue nginx taking 100% of cpu when even just return from cache! did you find any solution? thanks
    – Amir Bar
    Nov 12, 2015 at 17:18
  • Same issue with nginx after upgrading php-fpm to 7.1 Mar 23, 2017 at 20:00

0

You must log in to answer this question.

Browse other questions tagged .