Litespeed Stops Working

#1
Hi,

I'm having trouble with litespeed on one of my webservers.

Litespeed stops working randomly, 1-2 times a day. It actually works but none of the websites are active. Also, sometimes it becomes very very slow, it takes 1 min to load a website. I check running processes and I see there lshttpd is consuming %50-60 CPU and lots of lsphp processes are waiting to be processed.

Restarting Litespeed(service lsws restart) doesn't solve the problems. I have to switch to Apache(everything works great with apache), wait a few minutes and switch back to litespeed to make it work again. Sometimes even that doesn't work, I have to remove /tmp*lshttpd directory while apache is running to be able to make litespeed running.

I receive no ddos attacks or something, if that was the case apache would fail. Apache is running when litespeed doesn't.

Tried uninstalling and reinstalling litespeed, made no config changes, but still I have this problem. Please offer me a solution for this problem, I have over 10 litespeed servers but I have this problem only on one of them and no idea about how to solve it(first time I see apache is more stable than litespeed).

System info:
Cloudlinux OS x86_64 (Litespeed LVE enabled)
cPanel 11.28.83
Litespeed v4.0.19

Any help will be appreciated.
 

mistwang

LiteSpeed Staff
#2
We have seen something like that when PCRE goes into a infinity loop.
Maybe you should load the debug build of LSWS. When it happens, strace the lshttpd process using too much CPU first, then send "SIGBUS" to that process with command

kill -BUS <pid_of_lshttpd>

It will create a core dump in /tmp/lshttpd/bak_core/, the call stack from the core file can tell where the problem probably is.

Please contact our support via email to get the download link for the debug build of LSWS.
 
#6
Hi,

Here is what I get when I do exactly what you told me to:

root@server4 [/tmp/lshttpd]# gdb /usr/local/lsws/bin/lshttpd /tmp/lshttpd/core.25490
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/lsws/bin/lshttpd...(no debugging symbols found)...done.

warning: core file may not match specified executable file.
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2
Core was generated by `litespeed'.
Program terminated with signal 7, Bus error.
#0 0x0000003643ecb14f in poll () from /lib64/libc.so.6
(gdb)


Please help me solve this.
 
#8
root@server4 [/tmp/lshttpd/cihan]# gdb /usr/local/lsws/bin/lshttpd /tmp/lshttpd/cihan/core.6332
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/lsws/bin/lshttpd...(no debugging symbols found)...done.

warning: core file may not match specified executable file.
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2
Core was generated by `litespeed'.
Program terminated with signal 7, Bus error.
#0 0x0000003643ecb14f in poll () from /lib64/libc.so.6
(gdb) bt
#0 0x0000003643ecb14f in poll () from /lib64/libc.so.6
#1 0x000000000040a79d in LshttpdMain::guardCrash (this=0x1d6cf70) at /home/gwang/release/httpd/httpd/main/lshttpdmain.cpp:2349
#2 0x000000000040910c in LshttpdMain::init (this=0x1d6cf70, argc=1, argv=0x7fff4b87e218) at /home/gwang/release/httpd/httpd/main/lshttpdmain.cpp:1625
#3 0x00000000004093a1 in LshttpdMain::main (this=0x1d6cf70, argc=1, argv=0x7fff4b87e218) at /home/gwang/release/httpd/httpd/main/lshttpdmain.cpp:1719
#4 0x000000000040517f in main (argc=1, argv=0x7fff4b87e218) at /home/gwang/release/httpd/httpd/main.cpp:121
(gdb) quit
root@server4 [/tmp/lshttpd/cihan]#


Still don't know what to do :(

P.S. There is no such a directory as /home/gwang
 
Last edited:

mistwang

LiteSpeed Staff
#9
Are you sure that you sent SIGBUS to the lshttpd process using high CPU?
This process is the watch dog process, only start new process if one of the children process dies. It should not use a lot of CPU.
Can you also do
"strace -tt -T -p <pid_of_lshttpd_using_high_cpu>"
before killing it with "SIGBUS"?
You can send the output to bug@litespeedtech...
 
Top