• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Help With NGINX and APC

kingston

Well-known member
#1
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?
 

p4guru

Well-known member
#4
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)
 

Deebs

Well-known member
#5
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.
 

MattW

Well-known member
#9
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.PNG

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.
 

Andy.N

Well-known member
#10
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.
 

kingston

Well-known member
#12
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?
 

kingston

Well-known member
#15
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.
 

kingston

Well-known member
#16
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.
 

kingston

Well-known member
#18
Lowered my max connections to 300. Seems to have gotten MySQL under control (15% usage). Cannot decide if I need more max connections though.