Nginx: mmap(MAP_ANON|MAP_SHARED, 2097152) failed (28: No space left on device)

Dear all,

I must kindly ask for your help again. I have installed nginx on dozens
of
VPS and never came across the problem that I am facing now on my newest
installation. When I try to (re-) start nginx, I get the following error
message:


nginx: [alert] mmap(MAP_ANON|MAP_SHARED, 2097152) failed (28: No space
left
on device)

Here are some values from my /etc/sysctl.conf:


Controls the maximum size of a message, in bytes

kernel.msgmnb = 65536

Controls the default maxmimum size of a mesage queue

kernel.msgmax = 65536

Controls the maximum shared segment size, in bytes

kernel.shmmax = 68719476736

Controls the maximum number of shared memory segments, in pages

kernel.shmall = 4294967296


Needless to say that I have 900 MB RAM and 49 GB disk space free. OS is
CentOS 6.

What am I missing? I am really pulling my hair right now! Thank you very
much for any hint in advance!

Kind regards
-A

Posted at Nginx Forum:

On 5 Oct2012, at 06:19 , dullnicker [email protected] wrote:

Needless to say that I have 900 MB RAM and 49 GB disk space free. OS is
CentOS 6.

What am I missing? I am really pulling my hair right now! Thank you very
much for any hint in advance!

Please show
sysctl vm.max_map_count

and ulimit -a

Dear Sergey,

thank you for helping out! Here are the outputs:

[root@c3 ~]# sysctl vm.max_map_count
vm.max_map_count = 65530

[root@c3 ~]# 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) 127163
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 256
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

Posted at Nginx Forum:

Sergey B. Wrote:

Nothing unusual here. It seems mmap failed because of
vm hypervisor settings/limits. Try to compile (gcc -o mmap_test
mmap_test.c)
and run (./mmap_test) simple test in attachment - it should not exit
with
errors.

Thank you very much, Sergey!

I compiled and ran the test and here is the result:

[root@c3 test]# ./mmap_test
65536 bytes mmaped
131072 bytes mmaped
262144 bytes mmaped
524288 bytes mmaped
mmap(MAP_ANON|MAP_SHARED, 1048576) failed, errno = 28

So there is an error. I guess I will have to contact the VPS provider
then…
Again, thank you for your help and support!

Kind regards
-A

Posted at Nginx Forum:

Just for future reference:
“shmpages size” had to get raised by the VPS provider. Works fine now.

Thanks again for the assistance!

Kind regards
-A

Posted at Nginx Forum:

On 5 Oct2012, at 11:03 , dullnicker [email protected] wrote:

Dear Sergey,

thank you for helping out! Here are the outputs:

Nothing unusual here. It seems mmap failed because of
vm hypervisor settings/limits. Try to compile (gcc -o mmap_test
mmap_test.c)
and run (./mmap_test) simple test in attachment - it should not exit
with
errors.