Debug lsphp process

Discussion in 'General' started by Sani, Mar 22, 2010.

  1. Sani

    Sani New Member


    I am getting some problem on my vps.

    On one of the domains, php script is giving request time out error due to going into an infinite loop. How could I debug or trace which files exactly are causing php loop?? (Or any info about it)

    The vps itself is working fine, no problem with any other account. It's just one account that is giving headache.

    when I do ps -aux | grep username
    username 14481 0.0 0.3 214111 12422 ? S 05:52 0:00 lsphp5
    username 14482 0.0 0.3 214111 12455 ? S 05:55 0:00 lsphp5
    username 14483 0.0 0.3 214111 12466 ? S 05:57 0:00 lsphp5

    I can see 10 process from that user and their PIDs. How can I check which files/functions are causing the problwm.

    I am using LiteSpeed 4.10 with Suhosin v0.9.29
    Last edited: Mar 22, 2010
  2. NiteWave

    NiteWave Administrator

    >On one of the domains, php script is giving request time out error due to going into an infinite loop

    a suggestion is to use xhprof( to profile the question page(or URL)

    another suggestion is to set "PHP suEXEC Max Conn" to 1, so one account only have 1 lsphp5 process. this will apply for all other accounts though.
    Last edited: Mar 23, 2010
  3. ffeingol

    ffeingol Well-Known Member

    If the process are still running you can also use strace against the process. That will give you the system calls being issued (not the PHP code) but it should give you an idea of what it's doing.
  4. Sani

    Sani New Member

    I am looking into it but it seems beyong my understanding. (I will try though)

    I actally tried to use it first. But since I have never done that before, I dont think I was able to get anything out of it.

    How will i use it??
    strace -p 14481
    (where 14481 is pid of one lsphp5 process the client is running)
    The user is running 10 process so 10 pids.
    Will appreciate your help.
  5. ffeingol

    ffeingol Well-Known Member

    Yup, just pick one and then strace -p #### (process-id). The output will then go wizzing by on your console/ssh session.

Share This Page