Re: Huge (100k+) number of processes

2006-04-26 Thread Charles Swiger

On Apr 26, 2006, at 10:50 AM, Dan Nelson wrote:

The problem is that kern.maxproc=20 line in /boot/loader.conf
only raised the real value to 21576. Is that authoritative, or should
I just try and run 200k processes? I only have 512Mb of RAM, and I
wonder if it's enough to run 100k+ of, say, /bin/sleep?


Make sure you have enough RAM to cover those 100k processes.  There's
code that limits maxproc to physpages/12 ("Limit maxproc so that kmap
entries cannot be exhausted by processes").  You can try removing that
code, but each process does require a couple of private pages.
Assuming 5 pages, you'll need 2 GB of RAM just for that overhead,
before you take into account any memory your application will  
allocate.


And then add at least three, maybe four pages-- one for TEXT, one for  
BSS, one for the heap, and one for the stack) for the most minimal  
reasonable process, and anything which uses libc is going to run  
dozens to ~100 pages-- /bin/sleep wants 410K resident, for example.


The pure text pages are not duplicated for each process, but even so,  
you'd need on the order of 20GB or RAM or swap to run 100,000  
instances of sleep.


FreeBSD scales into the thousands of processes OK, and might do 10K  
or 20K under extreme circumstances, but that's almost certainly not  
the right architecture to head towards; a smaller number of  
persistent server processes along the lines of apache's preforked  
children or a multithreaded or poll()/select() based concurrent  
design are going to be better


--
-Chuck


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Huge (100k+) number of processes

2006-04-26 Thread Andrew Pantyukhin
On 4/26/06, Dan Nelson <[EMAIL PROTECTED]> wrote:
> In the last episode (Apr 26), Andrew Pantyukhin said:
> > On 4/26/06, Iantcho Vassilev <[EMAIL PROTECTED]> wrote:
> > > On 4/26/06, Andrew Pantyukhin <[EMAIL PROTECTED]> wrote:
> > > > I was wondering if it's possible to run over 100k processes
> > > > simultaneously on a FreeBSD box with sufficient amount
> > > > of RAM (and CPU power).
> > >
> > > Sure,why not?
> >
> > The problem is that kern.maxproc=20 line in /boot/loader.conf
> > only raised the real value to 21576. Is that authoritative, or should
> > I just try and run 200k processes? I only have 512Mb of RAM, and I
> > wonder if it's enough to run 100k+ of, say, /bin/sleep?
>
> Make sure you have enough RAM to cover those 100k processes.  There's
> code that limits maxproc to physpages/12 ("Limit maxproc so that kmap
> entries cannot be exhausted by processes").  You can try removing that
> code, but each process does require a couple of private pages.
> Assuming 5 pages, you'll need 2 GB of RAM just for that overhead,
> before you take into account any memory your application will allocate.
>
> Are you sure you need 100k separate processes running?
>
> --
> Dan Nelson
> [EMAIL PROTECTED]
>

Hmm, I have 2Gb boxes around, but no 4 or 8Gb ones running
FreeBSD. I'm just foolishly interested in running 200k of more or less
real (but very simple) processes under FreeBSD...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Huge (100k+) number of processes

2006-04-26 Thread Dan Nelson
In the last episode (Apr 26), Andrew Pantyukhin said:
> On 4/26/06, Iantcho Vassilev <[EMAIL PROTECTED]> wrote:
> > On 4/26/06, Andrew Pantyukhin <[EMAIL PROTECTED]> wrote:
> > > I was wondering if it's possible to run over 100k processes
> > > simultaneously on a FreeBSD box with sufficient amount
> > > of RAM (and CPU power).
> >
> > Sure,why not?
> 
> The problem is that kern.maxproc=20 line in /boot/loader.conf
> only raised the real value to 21576. Is that authoritative, or should
> I just try and run 200k processes? I only have 512Mb of RAM, and I
> wonder if it's enough to run 100k+ of, say, /bin/sleep?

Make sure you have enough RAM to cover those 100k processes.  There's
code that limits maxproc to physpages/12 ("Limit maxproc so that kmap
entries cannot be exhausted by processes").  You can try removing that
code, but each process does require a couple of private pages. 
Assuming 5 pages, you'll need 2 GB of RAM just for that overhead,
before you take into account any memory your application will allocate.

Are you sure you need 100k separate processes running?

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Huge (100k+) number of processes

2006-04-26 Thread Andrew Pantyukhin
On 4/26/06, Iantcho Vassilev <[EMAIL PROTECTED]> wrote:
> Sure,why not?
>
>
> It`s FreeBSD for God sake!

Yeah, I know :-)

The problem is that kern.maxproc=20 line in
/boot/loader.conf only raised the real value to 21576.
Is that authoritative, or should I just try and run 200k
processes? I only have 512Mb of RAM, and I wonder
if it's enough to run 100k+ of, say, /bin/sleep?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Huge (100k+) number of processes

2006-04-26 Thread Iantcho Vassilev
Sure,why not?


It`s FreeBSD for God sake!

On 4/26/06, Andrew Pantyukhin <[EMAIL PROTECTED]> wrote:
>
> I was wondering if it's possible to run over 100k processes
> simultaneously on a FreeBSD box with sufficient amount
> of RAM (and CPU power).
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> [EMAIL PROTECTED]"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Huge (100k+) number of processes

2006-04-26 Thread Andrew Pantyukhin
I was wondering if it's possible to run over 100k processes
simultaneously on a FreeBSD box with sufficient amount
of RAM (and CPU power).
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"