lkml.org 
[lkml]   [1997]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: 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>
-----------------------------------------------------------


\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.046 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site