Help With NGINX and APC

kingston

Well-known member
I loaded another license of Xenforo on my VPS and it crawled to a halt. I was recommended to increase the memory size of APC (I doubled it to 1024) and update APC as well. I did have Ngninx 1.2.4, APC 3.1.9, and PHP-FPM running just fine before the installation. Just updated APC to 3.1.14 and now I am getting 100% misses. Any idea what I am not setting correctly?
 
Do not use APC 3.1.14. I have noticed that it will only cache 1 PHP file and nothing else. Not had time to check to see if it has been reported as a bug. 3.1.13 and below work fine.
 
Do not use APC 3.1.14. I have noticed that it will only cache 1 PHP file and nothing else. Not had time to check to see if it has been reported as a bug. 3.1.13 and below work fine.
strange no probs here, just had a client upgrade to PHP 5.4.10, APC 3.1.14 and Nginx 1.2.6 and all caching fine (all software source compiled)
 
strange no probs here, just had a client upgrade to PHP 5.4.10, APC 3.1.14 and Nginx 1.2.6 and all caching fine (all software source compiled)
On 2 machines, both running PHP 5.3 if I download and compile APC 3.1.14 using PECL then it fails to cache more than 1 file. Not had time to do further investigation so rolled back to 3.1.13 and the problem goes away. This implies an issue with 3.1.14 possibly.
 
Updated to php 5.4 and it seems to work, but i cannot use FPM. bit of a cluster right now. had to go to fast-cgi.
 
How long before your APC memory is 100% fragmented? I got it reach in the high 90% within 24 hours and I have to restart the APC to purge them.
I wonder if there is a better way to automate the process.
I've never actually had it go 100% fragmented.

APC2.webp

Fragmentation was worse when I was using APC to cache the XF backend, but I'm using Libmemcached for that, so APC sings along nicely.
 
I've never actually had it go 100% fragmented.

View attachment 39153

Fragmentation was worse when I was using APC to cache the XF backend, but I'm using Libmemcached for that, so APC sings along nicely.
Arg. That's why. I'm using APC for XF backend and it fills up rather quickly. I used to have a cron job that restart the APC every day at midnight. It works on my smaller server but not on the main one so it's a bummer.
 
So I think I fumbled through some stuff and I have APC working with FCGI PHP and NGINX but I would prefer FPM. When I start FPM (and kill fcgi) I can see the process is running but PHP isn't working. I haven't changed teh default ports or anything. Any ideas where to start?
 
Do not use APC 3.1.14. I have noticed that it will only cache 1 PHP file and nothing else. Not had time to check to see if it has been reported as a bug. 3.1.13 and below work fine.
Strange definitely seems fine for me.

Image%202013.01.12%208:59:46%20PM.png
 
So I figured it out (and hopefully this will help someone else). I was thinking by default everything would be setup to the same thing and just work. I had fastcgi pointing to localhost:9000 and thought FPM would listen there. I did find it weird I could start fastcgi and FPM and they would both be running and work listening on the same address. Well FPM is listening on a socket. So I had to point

fastcgi_pass unix:/var/run/php5-fpm.sock;
instead of:
fastcgi_pass 127.0.0.1:9000;

Hopefully that will help someone out.
 
OK, so here is where I am at now.

I have NGINX 1.2.4, APC 3.1.14, and PHP-FPM Version 5.4.9-4~precise+1

My server is Intel(R) Xeon(R) CPU E7- 2850 @ 2.00GHz, 2 cores with 4 gig of ram (only 1.5 is in use).

My forum is constantly hanging when accessing individual threads (IDK why). This was not a problem before upgarding to the latest versions of all three. I am trying to trouble shoot, but I honestly cannot find the bottleneck.

NGINX has 2 worker processes and 40 worker connections (I have tried 8192 worker connections and it is the same result).

I have APC set to run the backend cache in the xenforo config and APC has 1 gig of RAM allocated to it (was trying to see if that is why it was slow).

Do I need to allocate more memory to PHP? or NGINX? Please help! We are a very busy board (we peak at 2k users) and it handled it fine before the upgrades of software.
 
OK my MySQL cpu usage is around 108%! I think this might be the issue? Any ideas? I am googling like a mofo to figure this out.
 
Lowered my max connections to 300. Seems to have gotten MySQL under control (15% usage). Cannot decide if I need more max connections though.
 
Back
Top Bottom