Forums Archive -> VectorStar News

Some happy fun config stuff... 2000-11-09 13:08:52
by lmbedore
I've added two particular features to the web server to keep things sane:
  • 5mb limit on CGI memory usage
  • 15 second CPU-time limit on CGI executions
  • 25 simultaneous CGI's running at once
This will keep CGI's from running amok, even if written with some infinite loop, so they won't be able to crash the web server. If you get Internal Server Errors where you used to have working scripts, you're probably using too much RAM! Write your CGI more efficiently (edit files line-by-line, don't cache 10,000 messages into RAM for a CGI that only needs to display 10 at a time, etc).

I've tested these changes with every major CGI i could find on the big VS sites... they appear to work very well. Note this: CPU-time is different than real time. If a CGI is using the CPU directly for a cumulative period of 15 seconds, it will be terminated. If you run a CGI that just sleeps all day, it could theoretically run for a year before it gains 15 seconds of CPU usage time.

The last one, 25 simultaneous CGI's running at once, I have not really tested yet. I will be testing that tonight with a number of different CGI's. This is basically here to prevent the server from being bogged down to a halt by a flood for 100 CGI hits at once. The way I calculated this? 25 * 5mb RAM max = 125mb RAM used. It'd be unrealistic for every CGI to use 5mb, but this would allow plenty of available swap space without sig11'ing the server. Vector currently has 64mb RAM (will most likely go to 128 shortly) and 160mb swap, so that leaves a very safe margin for the meantime.

Got Q's? email me.