1. 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

Discussion in 'Server Configuration and Hosting' started by kingston, Jan 10, 2013.

  1. kingston

    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?
     
  2. Deebs

    Deebs Well-Known Member

    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.
     
    Andy.N, HWS and Slavik like this.
  3. kingston

    kingston Well-Known Member

    well dang
     
  4. p4guru

    p4guru Well-Known Member

    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)
     
  5. Deebs

    Deebs Well-Known Member

    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.
     
  6. kingston

    kingston Well-Known Member

    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.
     
  7. MattW

    MattW Well-Known Member

    I've not seen any issues with 3.1.14 on PHP 5.4.9

    APC.PNG
     
  8. Andy.N

    Andy.N Well-Known Member

    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.
     
  9. MattW

    MattW Well-Known Member

    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 likes this.
  10. Andy.N

    Andy.N Well-Known Member

    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.
     
  11. MattW

    MattW Well-Known Member

  12. kingston

    kingston Well-Known Member

    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?
     
  13. Andy.N

    Andy.N Well-Known Member

  14. digitalpoint

    digitalpoint Well-Known Member

    Strange definitely seems fine for me.

    [​IMG]
     
  15. kingston

    kingston Well-Known Member

    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.
     
  16. kingston

    kingston Well-Known Member

    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.
     
  17. kingston

    kingston Well-Known Member

    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.
     
  18. kingston

    kingston Well-Known Member

    Lowered my max connections to 300. Seems to have gotten MySQL under control (15% usage). Cannot decide if I need more max connections though.
     
  19. MattW

    MattW Well-Known Member

    have you tried running mysqltuner.pl to make sure it's optimized?
     
    Luis likes this.
  20. kingston

    kingston Well-Known Member

    I haven't. Does that need to be installed or is it already there?
     

Share This Page