The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Nginx, FCGI, APC troubles, oh my!

Discussion in 'General Discussion' started by syne, Feb 13, 2011.

  1. syne

    syne Registered

    Joined:
    Feb 13, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello there,

    I have a new VPS with WHM/cPanel installed on what roughly 750 mb ram, and 1.8dedicated CPU.

    I have been trying nonstop for the past week to optimize it. So far, I have tried installing nginx via nginxcp.com. That went fine, but I dont notice much of a speed increase. it says its running, I can see the process sitting there in top. Other then that, i dont know how to test if its really helping or not.

    Then, i decide to move on and install APC. Well, this is where tons of problems start happening and my server crashes numerous times. BTW, I have roughly 10 websites with w3 total cache installed. So, I install APC and give it some decent parameters. I copy the apc.php over into a few sites... One of them in particular, whenever I hit the refresh data, goes something like this "3 hits, 329 misses." refresh, 1 second later, "49 hits, 3742 misses" refresh again, literally 1 second later, "1 hit, 1 miss". Also, the fragmentation jumps from 0 to 100% within seconds, back and forth repeatedly.

    On another site, the APC.

    I don't know whats going on with that and it seems to me that it probably isnt even working. APC is highly regarded as being superior to xcache and eaccelerator in almost every comparison aspect.

    Now, with APC running, and roughly 10+ sites all transferred over, I turn on FCGI via WHM as the php handler. The server now loads persistent processes of every site, hovering around 10%, or 70mb of ram. Swap starts filling up uncontrollably. BUT, the sites are loading very fast! That's what I wanted to accomplish, but within 30 minutes, the server crashes.

    I have what i am calling "beyond a headache" with all this. I load nginx correctly(it seems) but I don't know what its doing or what all the hype is. I guess I need to have 5k visitors in one day to notice? APC doesnt seem to be doing anything and never has an uptime of more then 1 minute.

    And now, I can't even compile apache/php via EasyApache to have mod_fcgi. I've looked into php-FPM, but it appears there is already loads of people with problems with that. I tried myself, adding a custom flag, and it wouldn't build correctly, giving the problem of "not being able to build 2 SAPI"

    Any suggestions? I just want something to work, and work as intended with these settings. If i wanted really mediocre performance, I would of stayed on a $5/month shared hosting plan. So far, thats 45 cheaper a month, and is providing the same performance with no headache.

    Thanks for any help that anyone can provide. I know I've touched on some things outside of "Cpanel and WHM" specifically, but I am running it on my server. A lot of other forums with these topics seem to have a lot of idiot responses with weeks between responses. This forum seems full of knowledgeable people, so I really do appreciate it.
     
  2. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    243
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bucharest
    APC or eAccelerator are not compatible with php compiled as CGI. You can try APC with apache / mod_php + nginx for serving static files. But i recommend at least 2 GB RAM for this.

    PS. in my tests wp-supercache works better that w3 total cache
     
  3. syne

    syne Registered

    Joined:
    Feb 13, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I dont see where in EasyApache that i can compile mod_php. is it a handler? or is it literally just the PHP module? If so, do I just cancel out FCGI and SuPHP and just compile with DSO and MPM Prefork?

    I wish I could have FCGI running, but I guess APC doesnt work well with that either? Also, it kills my server.

    Thanks for the response. Any additional help would be great!
     
  4. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    243
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bucharest
    Yes, mod_php (DSO) is the php module compiled in apache. Load faster than suPHP but use more memory (because module is loaded for each hit). You can comine it with APC as a php accelerator and nginx on frontend for static files.

    See: Apache PHP Request Handling
     
  5. syne

    syne Registered

    Joined:
    Feb 13, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Okay. Thanks for the info. I am starting to better understand now.

    Only issue now is, when running DSO, and checking apc.php, im getting all sorts of weird info. 100% fragmentation, huge amounts of misses, and everytime I hit refresh, it all changes as if they're all just random numbers with no meaning.

    Also, I notice the DSO processes are staying alive. This eventually runs all my ram out, and starts using swap and crashes my server.

    Is FCGI + Nginx > DSO + APC + Nginx?

    I hear this talk about "my server handles 500 concurrent users" or whatever, and my server crashes with just 10-12 instances of PHP running. How are these people achieving that kind of performance? My nginx process in top always remains at around .8% RAM... Doesn't seem to have much activity.

    Thanks for your help, with each response, I'm learning more and testings things out. I really do appreciate it.
     
  6. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    I'm really interested in this topic, please go head, come here and continue.
     
Loading...

Share This Page