Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: FastCGI vs other options - got to work with APC

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    4
    cPanel/WHM Access Level

    Root Administrator

    Question FastCGI vs other options - got to work with APC

    Hi to you all

    My question is proberly simple, but im gonna rent a server very soon, and currently working with the way everything shut be setup on the server.

    Im gonna use one of there official resellers, since they offer support for cPanel my host dont do that, and i want to be able to get support.

    But here is the question i belive APC is currently the best php caching plugin, and it will sooner or later from what i have read, be includet in to php disto it self, but for now its not, so fare i can se that it dossent work with suPHP, or for that matter suEXEC?, but dos it work with DSO/mod_php and/or mod_ruid2, and what is fastest and delivers the best output speed wize? the server is mainly gonna run Wordpress scripts, ad top 150 Domains, since i dont want to overload the server, and want to deliver a good hosting experience.

    Some server info.
    CPU: I7-2600 Quad with HT (I know this is a desktop processor, but compared to some of the minor Xeon processors its alot stronger, if you make some benchmarking)

    Ram: 16GB DDR3

    HDD: 2x3TB 6Gb/s they are gonna run in raid 1

    Dont think its a bad server?

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,611
    cPanel/WHM Access Level

    Root Administrator

    Default Re: FastCGI vs other options - got to work with APC

    Correct, suPHP doesn't work with OPCode caching. SuExec doesn't have anything to do with it, though. You can have SuExec on for DSO or FCGI and APC would still function.

    DSO + mod_ruid2 should function with OPCode caching as does FCGI.

    Right now, APC isn't provided as part of EasyApache, so you'd have to manually install and configure it.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    38

    Default Re: FastCGI vs other options - got to work with APC

    Quote Originally Posted by cPanelTristan View Post
    Correct, suPHP doesn't work with OPCode caching. SuExec doesn't have anything to do with it, though. You can have SuExec on for DSO or FCGI and APC would still function.

    DSO + mod_ruid2 should function with OPCode caching as does FCGI.

    Right now, APC isn't provided as part of EasyApache, so you'd have to manually install and configure it.
    Hi, sorry to re-open this old thread but it pertains to my issue. I am running Magento Store and soon found with FastCGI and the default file based Cache for Magento, the store is running very slow. After researching I found APC to be the answer. I used WHM to install APC Pecl Module and it was running fine. But, because Fast_CGI was used the caching did not work. If i go to apc.php and look at the files, no files were being cached. From what I read online but do not fully understand is that FastCGI spawns PHP processes separately so it really isn't set up to work with APC.

    So then I change my php.conf to run in DSO and now the APC caching is working and really fast! Can you explain how FastCGI can work with APC??

    Also, now I must chmod upload directories to 777. Is this dangerous? Could my sites be easily hacked?

    Please advise the best way to get APC to work but exposing my server to risk.

    Thanks for your help. Dan

  4. #4
    Member
    Join Date
    Feb 2013
    Posts
    21
    cPanel/WHM Access Level

    Root Administrator

    Default Re: FastCGI vs other options - got to work with APC

    Look into running Magento with mod_ruid2 and DSO. This should fix permission issues with CMS such as WordPress, Joomla and Magento. So the set up would be:

    mod_ruid2+DSO with APC enabled and folders set to 755 and files set to 644 with user:user ownership.

    Make a backup of your account before you proceed with these changes.

  5. #5
    Member
    Join Date
    Sep 2007
    Posts
    38

    Default Re: FastCGI vs other options - got to work with APC

    Thanks Max. I am running DSO and APC now and do have permission problems but the server runs pretty darn fast. In your opinion, if I configure with mod_ruid2 will the performance be the same or will I see a performance hit?

    Thanks, Dan

  6. #6
    Member LeadDogGraphics's Avatar
    Join Date
    Feb 2012
    Location
    West Palm Beach, FL
    Posts
    91
    cPanel/WHM Access Level

    Root Administrator

    Default Re: FastCGI vs other options - got to work with APC

    No, you won't take a performance hit. I also run mod_ruid2 with APC for WordPress hosting and it runs great.

    Just make sure your server has the standard security precautions taken care of. I would always suggest letting a professional handle your security setup/audit just in case, for around $150 you can't go wrong with knowing you are safe. Check these guys out, /http://solidshellsecurity.com/ the owner Travis is awesome at linux security.
    Lead Dog Graphic Studio, LLC - Fully Managed Custom Websites
    Custom Web Design | WordPress Design | Responsive Web Design

  7. #7
    Member
    Join Date
    Jan 2013
    Posts
    18
    cPanel/WHM Access Level

    Root Administrator

    Default Re: FastCGI vs other options - got to work with APC

    Quote Originally Posted by LeadDogGraphics View Post
    No, you won't take a performance hit. I also run mod_ruid2 with APC for WordPress hosting and it runs great.

    Just make sure your server has the standard security precautions taken care of. I would always suggest letting a professional handle your security setup/audit just in case, for around $150 you can't go wrong with knowing you are safe. Check these guys out, SolidShellSecurity | Web Hosting, Security, Server Management Services the owner Travis is awesome at linux security.
    Thanks for that info.

    I've heard good things about them. I will check them out.
    Last edited by fightforfreedom; 02-06-2013 at 12:12 PM.

  8. #8
    Member
    Join Date
    Sep 2007
    Posts
    38

    Default Re: FastCGI vs other options - got to work with APC

    Thanks for the info. I will check out the security experts too.

  9. #9
    Member
    Join Date
    Sep 2007
    Posts
    38

    Default Re: FastCGI vs other options - got to work with APC

    Hi, just recompiled Apache with Apache Ruid2 and it is running great and fast using APC.

    Should I leave Apache suEXEC on?

    Dan

  10. #10
    Member
    Join Date
    Oct 2012
    Location
    Denver, Colorado, United States
    Posts
    62
    cPanel/WHM Access Level

    DataCenter Provider

    Default Re: FastCGI vs other options - got to work with APC

    Quote Originally Posted by max_payne View Post
    Look into running Magento with mod_ruid2 and DSO. This should fix permission issues with CMS such as WordPress, Joomla and Magento. So the set up would be:

    mod_ruid2+DSO with APC enabled and folders set to 755 and files set to 644 with user:user ownership.

    Make a backup of your account before you proceed with these changes.
    Mod_ruid2 allows Apache to run as the cPanel user, so why not set folders to 750 and 640? This will help if a cpanel account is hacked (via exploit in cms, etc) and used to create symlinks (by reading /etc/named.conf - can also use 640) to other accounts on the system. Even if they symlink to a good file within another cpanel accunt, they won't be able to read it.

  11. #11
    Member
    Join Date
    Sep 2007
    Posts
    38

    Default Re: FastCGI vs other options - got to work with APC

    Hello, since I change over to mod_ruid2 my magento site crashed when APC could not allocate enough memory. I cleared the opcode cache and it is back up but now there are hits than misses showing in the APC.php control panel.

    Can some suggest how I can configure APC so that it does not crash? Do I need ot allocate more memory, or do I need a server with more RAM? I am not sure switching to ruid2 was the right thing for me..

    Any advise would be greatly appreciated. Thanks, Dan

  12. #12
    Member
    Join Date
    Feb 2013
    Posts
    21
    cPanel/WHM Access Level

    Root Administrator

    Default Re: FastCGI vs other options - got to work with APC

    Increase the following apc memory limit in php.ini:

    extension="apc.so"
    apc.enabled=1
    apc.shm_segments=1
    apc.shm_size=32M <--------- increase to higher number

    I also suggest running eAccelerator instead of APC if memory is an issue on the server. eAccelerator can also be installed via easyapache and therefore does not require manual installation like APC does. Both Op-Code caching software essentially do the same thing.

    I also can't stress enough how important it is to backup your cPanel accounts before you push account wide permission and ownership changes. The last thing you want on your hands is a site that breaks because you changed ownership on all files and folders. If mod_ruid2 does not work out for you, you can easily restore the accounts as they were before changes were made. From my experience, mod_ruid2 works perfectly with CMS such as WordPress. I recently was able to bring down a server load for a friend who was experiencing a load of 50+ on the server. I changed the handler from SuPHP to DSO with mod_ruid2 enabled and installed eAccelerator. Server load dropped to under 1 in a matter of 5 minutes! You are not always going to improve performance that much with just an Op-Code caching software alone, but it helps a lot!
    Last edited by max_payne; 02-25-2013 at 07:03 PM.

  13. #13
    Member
    Join Date
    Sep 2007
    Posts
    38

    Default Re: FastCGI vs other options - got to work with APC

    Thanks Max.

    This is what I have in my PHP.INI now:
    extension=apc.so
    apc.shm_size = 256M
    apc.num_files_hint = 10000
    apc.user_entries_hint = 10000
    apc.max_file_size = 5M

    My server has 1Gig of RAM.

    Would it be wise to set the apc.shm_size to 512M?

    I will look into switching eAccelerator also.

    Thanks, Dan

  14. #14
    Member
    Join Date
    Feb 2013
    Posts
    21
    cPanel/WHM Access Level

    Root Administrator

    Default Re: FastCGI vs other options - got to work with APC

    That setting is too high for 1 GB of guaranteed RAM. Are you getting the 'pool memory errors' often on the site? Try the switch to eAccelerator for a few days and see how it goes.

  15. #15
    Member
    Join Date
    Sep 2007
    Posts
    38

    Default Re: FastCGI vs other options - got to work with APC

    is 256MB too high?

    I made a few more tweaks to the APC config.
    apc.stat=0
    apc.optimization=0
    apc.shm_segments=1
    apc.enable_cli=1
    apc.cache_by_default=1
    apc.include_once_override=1

    I will keep an eye on it for a while. switching to eAccelerator will require me to rebuild apache which takes about 1/2 hour or so...
    So I may make the switch if I run into more problems with APC

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 09-06-2011, 10:07 PM
  2. fcgid (FastCGI) and APC shared cache
    By larwilliams in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 11-05-2009, 01:21 PM
  3. How to optimize FastCGI and work with mod_userdir
    By cesarlwh in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 08-20-2009, 08:40 AM
  4. How to Install APC?
    By smachol in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 05-09-2008, 10:22 PM
  5. APC and eAccelerator
    By Fernis in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 12-02-2007, 08:33 PM