OpenLiteSpeed overriding LSAPI_MAX_CHILDREN per user/domain?

mcormick

Verified User
Joined
Jan 31, 2023
Messages
10
I'm running LSPHP in PROCESSGROUP mode. My /usr/local/directadmin/custombuild/custom/openlitespeed/conf/httpd-phplimits.conf defines the webserver's default maxConns and PHP_LSAPI_CHILDREN.

Is it possible to override those values on a per-user and/or per-domain level?
  • The docs only seem to mention overriding LSPHP_Workers in the .htaccess file, but I wouldn't think allowing tenants to increase the number of workers is a smart thing to do?
  • I tried using DirectAdmin conditional statements in the httpd-phplimits.conf file, but they aren't supported there.
 
Putting the following into Custom HTTPD Configurations -> openlitespeed.conf -> Customize -> Top text area, seems to work for me, setting lower (or higher) settings for maxConns and PHP_LSAPI_CHILDREN:

Code:
  # Custom extProcessor definition, so we can set different maxConns
  # and PHP_LSAPI_CHILDREN. This will override the definitions in
  # /usr/local/lsws/conf/httpd-extprocessors.conf and
  # /usr/local/lsws/conf/httpd-phplimits.conf for this virtualHost only.
  extProcessor lsphp|LSPHP1_RELEASE| {
    type                lsapi
    address             uds://tmp/lshttpd/lsphp|LSPHP1_RELEASE|.sock
    autoStart           1
    path                /usr/local/php|LSPHP1_RELEASE|/bin/lsphp

    # Custom settings (similar to contents of httpd-phplimits.conf):
    maxConns            10
    env                 PHP_LSAPI_CHILDREN=10
    env                 LSPHP_ENABLE_USER_INI=on
    initTimeout         60
    memSoftLimit        2047M
    memHardLimit        2047M
    procSoftLimit       400
    procHardLimit       500
    backlog             100
    instances           1
    priority            0
    retryTimeout        0
    persistConn         1
    pcKeepAliveTimeout
    respBuffer          0
  }

It will override the default extProcessor with the same name in the global scope. From what I've found, you do not need to use a different value for 'address'.
 
Back
Top