Is this normal? (~450 processes)

#1
# ps aux | grep lsphp | wc -l
457

Code:
extprocessor lsphp71 {
  type                    lsapi
  address                 uds://tmp/lshttpd/lsphp.sock
  maxConns                150
  env                     PHP_LSAPI_MAX_REQUESTS=500
  env                     PHP_LSAPI_CHILDREN=35
  initTimeout             60
  retryTimeout            0
  persistConn             1
  pcKeepAliveTimeout      60
  respBuffer              0
  autoStart               1
  path                    $SERVER_ROOT/lsphp71/bin/lsphp
  backlog                 100
  instances               150
  priority                0
  memSoftLimit            2047M
  memHardLimit            2047M
  procSoftLimit           400
  procHardLimit           500
}
for some reason we have about 450 lsphp processes, and since we only had assigned 12GB ram, the server choked. We could increase RAM, but i'd like to know if this is normal ? And what would a good config be for a server with 12GB ram?
 

lsfoo

Moderator
#2
Could you check the parent process IDs? Are they mostly spawned from a litespeed process or from a lsphp process?
 
#3
Hello,

Please see refered image.

http://imgur.com/a/zoH6k
http://imgur.com/a/zoH6k
Would you like to describe "lscgid" and why they spawn there, and not under "lshttpd" ?
( i have restarted and tweaked the server a little. new config is : )

Code:
extprocessor lsphp71 {
  type                    lsapi
  address                 uds://tmp/lshttpd/lsphp.sock
  maxConns                100
  env                     PHP_LSAPI_MAX_REQUESTS=100
  env                     PHP_LSAPI_CHILDREN=10
  initTimeout             60
  retryTimeout            0
  persistConn             1
  pcKeepAliveTimeout      60
  respBuffer              0
  autoStart               1
  path                    $SERVER_ROOT/lsphp71/bin/lsphp
  backlog                 100
  instances               100
  runOnStartUp            1
  extMaxIdleTime          60
  priority                0
  memSoftLimit            300M
  memHardLimit            300M
  procSoftLimit           30
  procHardLimit           40
}
How can i easily figure out which settings are "the best"?

Br
 

lsfoo

Moderator
#4
Please try:

Code:
PHP_LSAPI_CHILDREN=150
...
instances               1
Those are the two settings that contribute to the total.
 

lsfoo

Moderator
#6
So PHP_LSAPI_CHILDREN is the number of children processes the main lsphp process can spawn.

instances control how many main processes are spawned. (so obviously 150 is a lot :D)

As for lscgid vs lshttpd, that's controlled by the autostart parameter. Since you have autostart 1, the processes are spawned at the beginning by lscgid. I think the description of the option describes it a bit more. In a bit of a overview description, lscgid manages external apps and lshttpd is where the requests are handled.
 
#7
So PHP_LSAPI_CHILDREN is the number of children processes the main lsphp process can spawn.

instances control how many main processes are spawned. (so obviously 150 is a lot :D)

As for lscgid vs lshttpd, that's controlled by the autostart parameter. Since you have autostart 1, the processes are spawned at the beginning by lscgid. I think the description of the option describes it a bit more. In a bit of a overview description, lscgid manages external apps and lshttpd is where the requests are handled.
The reason for the first quote of setup, is that i found it when i "How to install open litespeed" etc... I do not know for which kind of server these settings are intended for really...
It hasnt really been a problem uptil now... a server that has been running for 17 days had memory issues, and requests started to timeout, and we found that 450 lsphp-processes were eating the RAM.
So we want to know a little why there had been so many processes, and if they are really necessary ?

What is 1 lsphp process doing ? And why is it good to have > 100? :)
 

lskagan

Administrator
#10
Neither of those guides have instances at 100 or children at 100. So what originally happened was Open LiteSpeed spawns 4 main processes by default and because you had 100 instances set it spawned 100 instances per process bringing you to 400 lsphp processes. The other ~50 were the children spawned by the instances to actually process the PHP pages for the vhosts. Usually we recommend trying to keep everything close to default and only change when needed. We have tweaked the default configuration highly to achieve max performance for most use cases. My advice would be to try to keep everything as close to default as possible and start a new thread if you experience a certain situation, we then could help direct you properly to what exact settings you need to change.
 
#11
Neither of those guides have instances at 100 or children at 100. So what originally happened was Open LiteSpeed spawns 4 main processes by default and because you had 100 instances set it spawned 100 instances per process bringing you to 400 lsphp processes. The other ~50 were the children spawned by the instances to actually process the PHP pages for the vhosts. Usually we recommend trying to keep everything close to default and only change when needed. We have tweaked the default configuration highly to achieve max performance for most use cases. My advice would be to try to keep everything as close to default as possible and start a new thread if you experience a certain situation, we then could help direct you properly to what exact settings you need to change.
Alright! I understand! :)
Where can i find a default config? :)
 
Top