EP ad NPROC limits – a look from inside

The main purpose of this article is to describe EP and NPROC limits in more details for better understanding of their operation.

So, EP limits purpose is to define the maximum amount of active connections to the webserver inside LVE (1 user account = 1 LVE). When we set EP limits for an account, then we strictly limit the number of concurrent Apache connections to be served by a specific website. Each time a website request enters LVE, the EP counter is being incremented.

Note that the EP counter value wouldn’t be incremented in case a PHP process inside LVE is calling some external process (like cron, sendmail, exim, mysql etc.), all of them would be considered as a single LVE entry – single connection, because EP counter doesn’t include the child processes created inside LVE.

NPROC limits purpose is to define the maximum number of processes inside LVE. Such as ssh/cron/php/pop3/imap etc. They don’t increment the value of the EP counter due to being executed with the LVE_NO_MAXENTER flag.

It’s important to note, that the NPROC limits should always be higher then the EP. Sometimes you could see that there is only 1 EP connection, but the PNO value is much higher (using the “lvetop” utility). There are two possible reasons of such behavior:

  1. The invoked PHP script has made a call to some external application from inside the user LVE (like cron, sendmail, exim, mysql etc.)
  2. In case you use any of the following handlers: PHP-LiteSpeed, FastCGI or PHP-FPM, there is a chance that additional child processes (like lsphp/fastcgi/php-fpm) could be spawned and stay inside LVE for some time.

It’s also important to note that such behavior is only actual for the mentioned handlers, as suPHP for example, terminates the process upon the PHP request completion, and in this case NPROC value most probably will be equal to EP value.

Leave a Reply

Your email address will not be published. Required fields are marked *