lsphp5 is using too much CPU

Discussion in 'General' started by hpham, Apr 19, 2009.

  1. hpham

    hpham New Member

    When using top, here is the result

    Usually, I don't see that much. Is there any way to find out it's because of bad script, or bad configuration of my lsws?

    Thanks.
  2. mistwang

    mistwang LiteSpeed Staff

    In suexec mode is each PHP instance uses its own independent in memory cache, not shared among PHP processes.

    I currently recommend eAccelerator with disk cache in /dev/shm .
  3. hpham

    hpham New Member

  4. hpham

    hpham New Member

    well... from the top command, when there are 13+ tasks running, the load still going up to 12+. There is still nearly 2GB free RAM.

    Any other tip please? I am using lsws 2-CPU license on quad-core CPU server
    Thanks.
  5. anewday

    anewday Moderator

  6. mistwang

    mistwang LiteSpeed Staff

    You need to check those php process using too much CPU see if anything wrong. "strace" should help.
    Is /dev/shm mounted as tempfs?
  7. hpham

    hpham New Member

    @anewday
    @mistwang: yes, /dev/shm is mounted as tmpfs. I will check strace if there is anything wrong.
  8. mistwang

    mistwang LiteSpeed Staff

    make sure the /dev/shm is not full, have a cron job clean it every 5-10 minutes.
  9. hpham

    hpham New Member

    I run strace today, here is the result
    mprotect? umask? all calls to mkdir error?
    Last edited: May 3, 2009
  10. mistwang

    mistwang LiteSpeed Staff

    It does not looks right.

    Better trace individual calls with

    strace -tt -T -p <pid>

    You can get a clue about what is going on as well.

Share This Page