[solved] lsphp command using 100+% cpu usage

Discussion in 'General' started by Ankit Singh, Aug 30, 2018.

  1. Ankit Singh

    Ankit Singh Member

    Hii, I have VPS with litespeed webserver everything is working fine but sometimes lsphp commands are using 100+% cpu usage when I saw with top command. I want to know why it is using cpu resources at high level. I am posting the screenshot of command line here. Please help me and look into the matter.
    Load average is 4.27, 4.20, 4.78
    ss.png
     
  2. Pong

    Pong Well-Known Member Staff Member

    100% only means one core. You may have many cores on the server. PHP sometimes could be very heavy depend on your appalication, nothing to do with LiteSpeed Web Server.

    You should enable cache for atestkqg domain, which will try to avoid PHP processes.
     
  3. Ankit Singh

    Ankit Singh Member

    I already have enabled cache and there are only 2 cores and some time it is using more then 300%
    Process List:-
    Screen Shot 2018-08-30 at 10.41.30 PM.png

    Strace:-
    Screen Shot 2018-08-30 at 10.53.46 PM.png
     
  4. Pong

    Pong Well-Known Member Staff Member

    maybe I did not clarify enough, High PHP usage is something on the PHP application, not on LiteSpeed, but LScache can help/mitigate such situation.
    What application do you use? Is it a wordpress site? What's the URL?
    Did you verify the header to ensure cthe ache is working?
     
    Ankit Singh likes this.
  5. Ankit Singh

    Ankit Singh Member

    It is codingniter website develpped in php and I found nothing in php code which can cause the issue even everything was working fine on a previous shared server.
     
  6. NiteWave

    NiteWave Administrator

    1. is cloudlinux on this server ?
    2. opcache enabled ?
    3. strace output for which process ?
     
  7. Ankit Singh

    Ankit Singh Member

    1. cloudlinux not installed
    2. yes opcache is enabled
    3. strace for stucked/hanged process with pid 2938
     
  8. Ankit Singh

    Ankit Singh Member

    Recent strace of such process
    Note:- these are last lines
    Screen Shot 2018-08-31 at 2.28.53 PM.png
     
  9. NiteWave

    NiteWave Administrator

    this will be more helpful to know which file it's reading ... endless reading likely a big problem.
    you can "lsof -p pid" to know which files the lsphp has opened.
     
  10. Ankit Singh

    Ankit Singh Member

    There was an issue with codeigniter system files, i just downgraded to previous version and it fixed the issue. thanks for your help
     
    NiteWave likes this.

Share This Page