CPU usage consumption

Discussion in 'Install/Configuration' started by anewday, Apr 9, 2008.

  1. anewday

    anewday Moderator

    Hi,

    When I switched to lsphp5 for nearly 2 days, the CPU usage is mostly consumed by nice. On the other hand, when server is running on lsphp4..the CPU usage is mostly consumed by user.

    Can you explain this behavior? I'm not sure if it's a good or bad thing. :confused: Thanks for your help.

    [​IMG]
    Last edited: Apr 9, 2008
  2. Lauren

    Lauren LiteSpeed Staff Staff Member

    When "priority" is set for lsphp external app, the CPU usage will be counted as nice.
  3. anewday

    anewday Moderator

    I just checked external app, lsphp4 priority is set to 0 whereas lsphp5 is "not set". The CPU usage is counted as user, contrary to what you've said.

    What is a good value to set for priority of lsphp4 and lsphp5 ?
    Last edited: Apr 9, 2008
  4. Lauren

    Lauren LiteSpeed Staff Staff Member

    when priority is 0, it will be counted as user, default value for external process is the server process priority + 1, so if lsphp5 is not set, it may default to 1. If it is not 0, it will be counted as nice in the "top" output.
    priority 0 or 1 does not make much difference.
  5. vivek

    vivek New Member

    Hello

    I am having problem with litespeed nowadays. The high server load problem

    The server configuration is as follows
    Intel Xeon Dual Core
    4GB RAM
    100mbps uplink
    cPanel/WHM

    The server load is always like 5-10
    It will go down to less than 1 sometimes,

    The sites are loading fine ,but dont know why the server load is staying high

    [​IMG]

    I checked top and found many times, EXIM is also causing the server load other than lsphp4. I contacted cPanel for checking this and here is the reply

    Vivek,
    I am not seeing this, however I am seeing that litespeed httpd's implementation of php is causing your load issues. Exim does not appear to be using any significant load at all.
    --
    Thank You,
    Matt Dees
    Technical Analyst 2
    cPanel, Inc.


    So, is there any performance tuning for litespeed?

    Thanks in advance
    Vivek
    Last edited: Apr 11, 2008
  6. vivek

    vivek New Member

    I also tried to swtch back to Apache for some hours and found low server load.
  7. anewday

    anewday Moderator

    Your config is identical, mine is a core2duo xeon 3060.

    What is your iowait when the load is high? I noticed the load jumps up to almost 2 when iowait hits 20% and higher for a period of a 2 seconds or more and the load only drops when iowait is returns to normal. Sometimes, it reaches almost 3. Most of the time, load is under 1 though. But, I wonder why it spikes like that, Apache does't behave this way.

    I think the lsphp process is causing the high loads too, it's always listed in the max cpu usage on WHM. There is over 2.5G of free ram according to free -m no bottlenecks on my system.

    PS what prog did you use to make this pic: http://status.suntexhosting.com/images/dynamic/small.php
    Last edited: Apr 10, 2008
  8. mistwang

    mistwang LiteSpeed Staff

    Does it have anything to do with that cPanel restart lshttpd frequently? Do you have php opcode cache installed?
    Please try the latest 3.3.10 release package.
    I may be able to check your server when I get a chance.
  9. anewday

    anewday Moderator

    [​IMG]

    every time when iowait is high, I see lsphp4 at the top of the process list according to the top command.

    user % is not that high now but when load hits 2-3, the user % is at least 12%
    Last edited: Apr 10, 2008
  10. anewday

    anewday Moderator

    Happening again:

    Code:
    top - 11:54:33 up 237 days, 15:01,  1 user,  load average: 6.06, 2.80, 1.65
    Tasks: 133 total,   2 running, 131 sleeping,   0 stopped,   0 zombie
    Cpu(s): 13.0% us,  4.9% sy,  0.0% ni, 24.3% id, 57.8% wa,  0.0% hi,  0.0% si
    Mem:   3114144k total,  3096468k used,    17676k free,    30220k buffers
    Swap:  2096440k total,    32348k used,  2064092k free,  2515412k cached
    
      PID USER      PR  NI %CPU    TIME+  %MEM  VIRT  RES  SHR S COMMAND                                                                
     8610 nobody    16   0   28   1:37.73  0.7 78908  20m  16m S lsphp4                                                                 
    10520 nobody    16   0    3   0:01.97  0.4 78788  10m 6884 S lsphp4                                                                 
    26474 nobody    15   0    2  15:04.07  0.4 14196  11m 3216 S lshttpd                                                                
    28275 mysql     22   6    1 131:28.83  7.4  733m 224m 2700 S /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pi
    Is it caused by mysql or lsphp4? :confused:

    [​IMG]

    Look at the big spike, most of the CPU usage is caused by lsphp4 running as user (priority 0) lsphp4 is likely the culprit.
    Last edited: Apr 12, 2008
  11. vivek

    vivek New Member

  12. vivek

    vivek New Member

    anewday , Do you have xcache installed ? I am going to remove it. I have xcache installed and is with 2GB cache.

    Let me try it. Will post the result after checking the load .
  13. anewday

    anewday Moderator

    No, I use eaccelerator with lsphp4.
  14. vivek

    vivek New Member

    EA !!!

    DONT! NEVER USE EA..

    Remove it and check your load
  15. vivek

    vivek New Member

    Also, did you check your EA cache folder size ?

    Xcache is better than EA. At least xcache will not store any cache file on your hard disk like EA, and thus saves space.
  16. anewday

    anewday Moderator

    I don't think it's EA because I get high loads with APC as well.

    I set EA to use shared memory instead of cahing files on the hard disk:

    eaccelerator.keys="shm"
    eaccelerator.sessions="shm"
    eaccelerator.content="shm"
  17. vivek

    vivek New Member

    ok, I dont have much information about EA.

    I just removed the litespeed installation and installed it again.
    compiled php and added zend and ioncube. I didnt add Xcache or APC or EA.

    Looks like everything is working fine. I can see the load is now less than 1 which is a good one.

    I am going to watch the load today.

    Here is the live status.

    [​IMG]
  18. anewday

    anewday Moderator

    Is your iowait high when server load is high?
  19. vivek

    vivek New Member

    Well, I didnt check it before :(
  20. miracle

    miracle New Member

    My server has similar issues.

Share This Page