16

It seems that the server is limited at ~32720 sockets... I have tried every known variable change to raise up this limit. But the server stay limited at 32720 opened socket, even if there is still 4Go of free memory and 80% of idle cpu...

Here's the configuration

~# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 63931
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 798621
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 2048
cpu time               (seconds, -t) unlimited
max user processes              (-u) 63931
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

net.netfilter.nf_conntrack_max = 999999
net.ipv4.netfilter.ip_conntrack_max = 999999
net.nf_conntrack_max = 999999

Any thoughts ? (This question as been asked on stack-overflow with no luck so far)

TheSquad
  • 395
  • 1
  • 3
  • 10

4 Answers4

8

I have found whats was limiting everything :

max_map_count

Thanks to everyone who answered !

TheSquad
  • 395
  • 1
  • 3
  • 10
2

You are looking in the wrong place for this one; you're not running into a user limit, you're running into a system limit which is generally the 15th power of 2 on a 32-bit system, which is what I'm guessing your system to be. Check:

 % cat /proc/sys/kernel/pid_max 
 32768
 %

But you can change that too; on a 32-bit machine that'd be 2**22 as an absolute upper limit, so:

% sudo bash -c 'echo 4194303 > /proc/sys/kernel/pid_max'
%

I'd be interested to know how you go.

Xerxes
  • 4,133
  • 3
  • 26
  • 33
1

If you're actually trying to look at the maximum number of sockets you can open connections with, you might try looking at cat /proc/sys/net/ipv4/ip_local_port_range ; this is the range of ports that the kernel will use for outbound sockets, and it has different defaults based on your distribution. Setting it to something like '1024 65535' is about as wide-open as you can get it; see if that helps things.

pjz
  • 10,497
  • 1
  • 31
  • 40
0

I 'm sorry if something similar is being said in the threads, but i don't have time to read them now :<

With a first look i see that the number of sockets you mention is about the half of the maximum user processes. As i can guess your have a seperate process for every socket (propably you run a server or something like that)

What you could do is to check the number of process the next time that you reach the socket's limit.

Just an idea, i don't know if it helps.

Nikolaidis Fotis
  • 1,994
  • 11
  • 13
  • nope, not that : # ps -ef | grep -c 'root' = 147 – TheSquad Aug 08 '10 at 20:41
  • is that under controlled environment ? could you make some checks ? for example, how many processes are created with every request ? Also, what's the priority of the server ? If you renice it does it change something ? If not, then i 'm almost sure that you reach either the process limit or the threads limit inside a process :> – Nikolaidis Fotis Aug 09 '10 at 00:49