0

I have a bunch of scripts, but some of them are higher priority than others:

/var/www/normal-priority/script1.pl
/var/www/normal-priority/script2.pl
/var/www/normal-priority/script3.pl

and

/var/www/high-priority/script1.pl
/var/www/high-priority/script2.pl
/var/www/high-priority/script3.pl

All running under mod-perl. They reside in separate directories.

From time to time, the normal-priority scripts get very busy, and the httpd servers "swamp out" the less frequently called high priority ones.

Is it possible to set aside n httpd servers so that they only listen for the "high priority" scripts?

Disco
  • 375
  • 2
  • 4
  • 12

1 Answers1

0

You can use the directive RLimitNPROC to limit the number of processes allowed to start in e.g. a directory. Since you're keeping the scripts in separate directories, this should work:

<Directory /var/www/high-priority>
  RLimitNPROC Max
</Directory>

<Directory /var/www/normal-priority>
  RLimitNPROC 4711  # Change this number to something that works for you
</Directory>

You can also set limits for CPU and memory usage.

Jenny D
  • 27,780
  • 21
  • 75
  • 114