dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
6
share rss forum feed


evilghost
Premium
join:2003-11-22
Springville, AL
reply to justin

Re: maximum number of open sockets, files, threads, etc..?

Limits can be enforced using /etc/security/limits.conf but I'm not sure that's what you're asking.

Ulimit is probably what you're looking for...

ulimit -a
 

Or optionally, a manual approach:
Maximum number of open files: cat /proc/sys/fs/file-max
Allocated, free allocated, and max FDs:  cat /proc/sys/fs/file-nr
 


justin
..needs sleep
Australian
join:1999-05-28
kudos:15

I know that, but 'unlimited' actually isn't. So I'm after the real upper limits determined by kernel design ...



sporkme
drop the crantini and move it, sister
Premium,MVM
join:2000-07-01
Morristown, NJ

UTSL!

Additionally, I'm sure one of the distros with good docs (Gentoo??) must have stuff like this spelled out somewhere.



evilghost
Premium
join:2003-11-22
Springville, AL
reply to justin

said by justin:

I know that, but 'unlimited' actually isn't. So I'm after the real upper limits determined by kernel design ...
Ok, use this approach:

#Maximum number of open files:
cat /proc/sys/fs/file-max  
 
#Allocated, free allocated, and max FDs:
cat /proc/sys/fs/file-nr  
 
#Max threads:
cat /proc/sys/kernel/threads-max
 
#Max half-open TCP:
cat /proc/sys/net/core/somaxconn
 


justin
..needs sleep
Australian
join:1999-05-28
kudos:15
Reviews:
·iiNet
reply to sporkme

I've been googling for a while and the answers are unclear otherwise I wouldn't bother posting here.

In part because (for threads) it depends on the stack size you limit things to. For fds and sockets wanting more than 65k (especially per process, but per maybe per machine) is a very specialized thing.

Even this topic (on max threads) came to an uncertain resolution:

»lkml.org/lkml/2006/8/15/222



justin
..needs sleep
Australian
join:1999-05-28
kudos:15
Reviews:
·iiNet
reply to evilghost

those are current max numbers, and they can be changed.

I'm after what the real upper limits actually are.

eg, from my lkml topic it seems that max number of processes (or threads) is 65k, and potentially 128k but then /proc blows up.

So presumably 65k open files (and therefore sockets) is a hard limit everywhere.

There are interesting implications. No you would not want 40k threads, or 40k processes, but you might want 100k simultaneous open tcp conversations. It isn't clear to me why this should be so difficult if the majority of the open conversations were idle.

Yet it appears to be an impossible task. Even on a 64bit machine with a whole pile of memory.


xargs

join:2000-08-25
Camarillo, CA

said by justin:

you might want 100k simultaneous open tcp conversations. It isn't clear to me why this should be so difficult if the majority of the open conversations were idle.
I'm working on a server that has just those requirements. It does appear that there's a 64K per-process open file limit, though I can't find any documentation to that effect. It's not a system-wide limit -- clients can open 64K connections into the server process from the same machine, giving 128K total open files:
$ cat /proc/sys/fs/file-nr
135360  0       296295
 
A call to getrlimit(RLIMIT_NOFILE) tells me the per-process limit is 250,000 (that's how I've configured it in /etc/security/limits.conf) but I can't seem to actually achieve that many open connections.

Have you found any information that this limit can be increased?