Messages in this thread | | | From | "Russell Coker - mailing lists account" <> | Date | Fri, 25 Jul 97 16:48:23 +1100 | Subject | Re: Reserved PID's |
| |
>> Isn't that already basically done via: >> if (nr_tasks >= NR_TASKS - MIN_TASKS_LEFT_FOR_ROOT) { >> in include/linux/tasks.h MIN_TASKS_LEFT_FOR_ROOT defaults to 4, but I >> generally raise it to 64. Ideally, this should stop anyone but root (or >> root owned processes) from filling the process table...if you have enough >> processes reserved for root. >> >inetd _is_ a root-owned process.
>If you have problems with inetd spawning too many processes, either patch >inetd do support counting and limiting the number of active processes per >socket, or use something like tcpserver which already has this code >built-in, or change the process in question to be its own daemon and >implement counting and limiting yourself. The first option actually is the >most difficult, assuming nobody has done this yet.
It's been done in xinetd. Here's a sample of my xinetd config file which shows how I'm limiting the system to 20 instances of smtp on an interface. I strongly recommend xinetd as it can solve many of these problems. It's better to solve them in user-land than in the kernel.
service smtp { id = smtp-normal socket_type = stream protocol = tcp wait = no user = qmaild server = /usr/local/sbin/tcpd/tcp-env server_args = /usr/sbin/qmail-smtpd nice = 5 instances = 20 passenv = interface = 203.29.19.1 }
service smtp { id = smtp-relay socket_type = stream protocol = tcp wait = no user = qmaild server = /usr/local/sbin/tcpd/tcp-env server_args = /usr/sbin/qmail-smtpd nice = 5 instances = 20 passenv = RELAYCLIENT interface = 10.10.10.8 }
-- ----------------------------------------------------------- In return for "mailbag contention" errors from buggy Exchange servers I'll set my mail server to refuse mail from your domain. The same response applies when a message to a postmaster account bounces. "Russell Coker - mailing lists account" <bofh@snoopy.virtual.net.au> -----------------------------------------------------------
| |