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.

suPHP and 100% cpu usage

Discussion in 'Workarounds and Optimization' started by Massoud, Feb 20, 2011.

  1. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    I recently change my shared environment to a VPS flor runing my joomla website, the vps has 4GB RAM and 2GHz Dual core processor, at first my admin panel was Plesk and my website had serious problem with accessing to the the files on the webserver and I notice that I need the SuPHP mod and because I wanted to get rid of this I change to cpanel, but in cpanel I have another seroius problem and that is performance.

    now with WHM/cpanel and SuPHP my website with less users work perfectly, and pages will open very quickly but when get to 200 visitors everything will totally different I monitor the process via TOP command in SSH connection but I got nothing

    my problem is when around 200 people try to open the website my cpu usage get to maximum 100%
    during last 2 weeks I studied alot about joomla performance and apache php and tried to reinstall different version of them via Easy Apache in WHM but nothing solve, while I was checking the cpanel forum I found something very interesting and that was this thread:
    http://forums.cpanel.net/f189/dso-vs-suphp-vs-fastcgi-146353.html

    Now I think my problem might be related to the suPHP and I tried to enable fcgi mode but when I select it in:
    Main >> Service Configuration >> Configure PHP and SuExec
    I'll get 503 Error and the website wont work.

    I really need your help and your kind advices to solve my problem and get better performance since I migrated to the VPS just for having more visitors but compare to the shared environment, I really believe that my website could handle more visitors.

    Please help me to install fcgi with any useful cache mode or configuration option that would suitable for Joomla CMS and let me have more visitors.

    Thank you in advance for any kind of advices.
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    Have you tweaked your apache and mysql services. Proper tweaking will result in a drastic change in Performance.
     
  3. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for your replay, No I do not how should I tweak them? please provide me any suitable document, and should I change SuPHP to FCGI or not?
     
  4. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    Please go through the below given URL which gives a better understanding on PHP handlers.

    DSO vs. CGI vs. suPHP vs. FastCGI | BoomShadow.net

    Either suphp or fastcgi depends on what is causing the issue (higher cpu usage or mem usage) For that a close monitoring of server is needed.

    You can use the below given post for Mysql tweaking.

    https://forums.cpanel.net/f189/extreme-disk-writes-server-io-load-mysqld-192241.html

    Apache tweaking depends on the RAM in the server, number of hits/domains etc. Let me know how can I help you more.
     
    #4 LinuxTechie, Feb 21, 2011
    Last edited: Feb 21, 2011
  5. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you very much for your quick reply,
    As I mention I run Joomla CMS on my vps with SuPHP and SuEXE my initial question is how can I run other Handlers like FCGI or DSO, I read a document in Cpanel Document center about their differences and I figured out that DSO is faster compare to others, but when I change to DSO in EasyApache Configuration of WHM, My CMS wont work correctly I could not find how should I set permission I mean how can I move from SuPHP to other handlers to test which one is perfect for me.
    With current configuration I wont have any problem with RAM usage, during last two week I monitor the resource via Top -c command and I can see at the worst situation I will use 500MB ram while the cpu usage is 100%.

    as I mention my VPS can handle around 200 hit at the same time and then get 100% cpu usage, my domain is /http://www.zoomit.ir

    I really appreciated for your kind help and I'm going to read the document that you provided me.
     
  6. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for your quick reply,

    I ran the sql database script and try to fix the notices, and after reading the document about Handlers I got the concept and now I think I should move to FastCGI instead of suPHP, since I have 4GB RAM and my problem is CPU Usage.

    But as I mention I have Joomla CMS with upload feature could please provide me a guide to run fastCGI and its right configuration to run cms without permission and disk write problem.

    By the way my domain is: /http://www.zoomit.ir
    PHP Built on: Linux vps-1039725-2926.manage.myhosting.com 2.6.18-028stab070.14 #1 SMP Thu Nov 18 16:04:02 MSK 2010 x86_64
    Database Version: 5.0.91-community
    Database Collation: utf8_general_ci
    PHP Version: 5.2.16
    Web Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
     
  7. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    If fastcgi is not yet compiled, you need to compile the handler via /scripts/easyapache.

    Please go through the below given Doc on more about FCGI.

    Apache PHP Request Handling
     
  8. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
  9. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    I have already posted my opinion in that thread.
     
  10. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    any one can help me to run FCGI without any problem ?
     
  11. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    with cPtechie help I could install FCGI on the server but the cpu usage is still high when I have 200 visitor at the same time please advice me with any configuration advices.
     
  12. Cindu

    Cindu Well-Known Member

    Joined:
    Feb 7, 2011
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Hey,

    Thats gud to hear that fcgi got installed. How many domains are there in the server? If evrything else checked did you gave a check on your php scripts?
     
  13. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    I have only one domain on the server and I've check whole code.
     
  14. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,469
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Sounds like a mod or plugin causing this to me. Disable any custom/non stock mods for that Joomla site for a few hours when it's busy and see if that helps. Could even be caused by a custom theme doing something it shouldn't be.
     
  15. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    I disable almost all of plugins and components and change the theme to the original one the only remain components is K2 plus nothing solved, is there any way that I can monitor more specific I just have:
    Top -c
    w
    netstat -n|grep :80|awk {'print $5'}| cut -f1 -d: | sort | uniq -c | sort -n
    and logs but I can not see anything odd
     
  16. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,469
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Do you have CSF installed?
     
  17. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    I used to install CSF and IPTables but now no, because some people like me could not see the website
     
  18. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    In PHPMYSql, I can see something strange in webserver info:

    Web server

    * cpsrvd 11.28.83
    * MySQL client version: 4.1.22
    * PHP extension: mysql


    in my shared host it is:
    * Apache
    * MySQL client version: 5.0.41
    * PHP extension: mysql

    What's differences between them and is it a possible for my cpu usage or not ?
     
  19. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    #19 Massoud, Feb 22, 2011
    Last edited: Feb 22, 2011
  20. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Re: 15 Core 128Mhz

    the export of :
    cat /proc/cpuinfo

    is enclosed.
     

    Attached Files:

Loading...

Share This Page