Litespeed using too much lsphp5 processes and memory

#1
Hello,

we are using the licensed Litespeed on a Quad CPU 8GB RAM dedicated server and we are very happy about it's performance. It's also using memcached.

We tested Litespeed on a Linode VPS server with Quad CPU and 1GB of RAM.

It was performing well, until the site had 60 people on it (according to Chartbeat). Then the server went out of memory and also out of 1GB of swap. Here's what it looked like in top:

Code:
top - 15:29:55 up 1 min,  1 user,  load average: 29.84, 9.14, 3.19
Tasks: 156 total,   2 running, 154 sleeping,   0 stopped,   0 zombie
Cpu(s):  8.7%us, 18.3%sy,  0.0%ni,  0.0%id, 72.9%wa,  0.0%hi,  0.0%si,  0.1%st
Mem:   1029508k total,  1011160k used,    18348k free,      876k buffers
Swap:  1048568k total,   559868k used,   488700k free,   159920k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                       
 1952 mysql     20   0  236m  70m 2404 S  155  7.0   3:28.72 mysqld                                         
  183 root      20   0     0    0    0 S    7  0.0   0:03.89 kswapd0                                        
 2490 www-data  20   0 47220  25m 3264 D    4  2.5   0:00.33 lsphp5                                         
 2491 root      20   0  8352 2676 2120 S    2  0.3   0:00.11 sshd                                           
 2477 www-data  20   0 48564  27m 3368 S    1  2.7   0:00.49 lsphp5                                         
 2495 www-data  20   0 23660 2124 1504 R    1  0.2   0:00.02 lsphp5                                         
  124 root      20   0     0    0    0 S    0  0.0   0:00.13 kblockd/0                                      
 2016 www-data   1 -19  8512 2868 1332 D    0  0.3   0:00.35 litespeed                                      
 2446 root      20   0  2548  912  660 R    0  0.1   0:00.17 top                                            
 2500 root      20   0  6896 3036 1768 D    0  0.3   0:00.01 lsb_release                                    
    1 root      20   0  2684 1088  844 S    0  0.1   0:00.48 init
Here's what the ps looked like, it had 60 lsphp5 processes, each taking different amount of memory, some only 7M, some 36M. And of course SQL.

Code:
www-data  2368  1.9  0.6  49076  7180 ?        S    15:28   0:02 lsphp5:/srv/www/public_html/
www-data  2383  2.5  1.0  55940 10408 ?        S    15:28   0:02 lsphp5:/public_html/site/wp
www-data  2490  2.4  3.5  57380 36396 ?        S    15:29   0:00 lsphp5:/srv/www/public_html/
mysql     1952  192  7.1 245716 73632 ?        Ssl  15:28   3:41 /usr/sbin/mysqld
Of course you can't resolve this issue just by looking at this. But consider, that our server with the paid licensed Litespeed is right now serving 170 users on that website (again, based on Chartbeat) with just two lsphp5 instances for this website. It's serving also other sites, so other lsphp instances server other websites, but the number is much lower, bellow 5 at this point.

Is that a problem of a configuration, or is that also a difference between commercial and free version?

Here's the recommendation I got from George at LSWS support:

"You need to tune lsphp5 external app configuration, reduce "Max connections" and "PHP_LSAPI_CHILDREN" from "35" to "10"."

What's your experience? Will lowering this setting avoid our memory issues? How will that affect our performance? I guess it might go up a bit, as in this case, there was too much of the overhead for so much processes.

Thanks,
Martin
 

NiteWave

Administrator
#2
yes, please try lower lsphp5 external app max connections and PHP_LSAPI_CHILDREN from 35 to 10.

looks like memory is the bottle-neck of this vps + php application, so have to reduce memory usage in various ways to avoid swap or increase vps memory to 2G, or move mysqld out of the VPS etc.
 
Top