git inside VPS fails on mmap [message #30525] |
Wed, 28 May 2008 07:44 |
|
pollux
Messages: 13 Registered: September 2006
|
Junior Member |
|
|
Hi,
I am trying to setup a git server inside a VPS. The git repository has fairly large objects (it's a local kernel tree).
The following error happens on git clone (using the git protocol):
2008-05-28_07:11:14.41523 [32100] Request upload-pack for '/git/linux-2.6.git'
2008-05-28_07:11:14.41641 fatal: packfile ./objects/pack/pack-95d32a83b9918b18223858e7349d5b64585b2a51.pack cannot be mapped.
Running stace on the git servers shows indeed a mmap failure with -ENOMEM:
[pid 32195] open("./objects/pack/pack-95d32a83b9918b18223858e7349d5b64585b2a51.pack", O_RDONLY) = 5
[pid 32195] fstat(5, {st_mode=S_IFREG|0444, st_size=155244017, ...}) = 0
[pid 32195] mmap(NULL, 155244017, PROT_READ, MAP_PRIVATE, 5, 0) = -1 ENOMEM (Cannot allocate memory)
Now what is weird is that I have no quota exceeded in /proc/user_beancounters (last columns is 0 everywhere). I have tried raising all quota to 9223372036854775807, no changes.
Any idea ?
Thanks
Host environment: 2.6.18-028stab053 x86_64
Guest OS: Debian Etch x86_64
|
|
|
|
Re: git inside VPS fails on mmap [message #30537 is a reply to message #30536] |
Wed, 28 May 2008 10:16 |
|
pollux
Messages: 13 Registered: September 2006
|
Junior Member |
|
|
1. The HN has 4 GB of RAM, + 4 of swap. It does not seem to have problems
# free
total used free shared buffers cached
Mem: 4041736 3972848 68888 0 433104 848136
-/+ buffers/cache: 2691608 1350128
Swap: 4194296 336 4193960
2. That, I don't know how to check. The host is 64-bits, so I assume there is no limitation on 4GB.
3.
# sysctl vm.max_map_count
vm.max_map_count = 65536
(same on the HN and on the guest)
The proc values shows no large number of maps:
# cat /proc/`pidof git-daemon`/maps | wc -l
16
Strace shows that git-daemon adds 27 mmaps before failing.
I tried raising vm.max_map_count to an arbitrary high number, no changes.
4. I don't know how to check that.
I would add that the HN is running 34 servers, maybe it is too big for its capacity ? AFAICT, there is no sign of saturation (cpu load is 0.14, There is some free RAM, etc.)
Thanks for your help
[Updated on: Wed, 28 May 2008 10:16] Report message to a moderator
|
|
|
|
|
|
|
|
Re: git inside VPS fails on mmap [message #30551 is a reply to message #30550] |
Wed, 28 May 2008 12:26 |
|
pollux
Messages: 13 Registered: September 2006
|
Junior Member |
|
|
Haha, I have been caught
git:~# uname -a
Linux git.inl.fr 2.6.18-028stab053 #1 SMP Fri Feb 15 16:06:31 CET 2008 x86_64 GNU/Linux
git:~# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
max nice (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) unlimited
max rt priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
|
|
|
|
|
|
Re: git inside VPS fails on mmap [solved] [message #30642 is a reply to message #30525] |
Fri, 30 May 2008 20:39 |
|
pollux
Messages: 13 Registered: September 2006
|
Junior Member |
|
|
Thanks to maratrus, I have found the solution ! It was indeed related to git, and not to OpenVZ.
Debian uses runit (http://smarden.org/runit/) to run git-daemon, and creates a default run file:
git:~# cat /etc/sv/git-daemon/run
#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec chpst -m64000000 \
git-daemon --verbose --base-path=/var/cache /var/cache/git
There is indeed a hardcoded (stupid) limitation. Removing it solved the problem.
Pierre
[Updated on: Fri, 30 May 2008 20:42] Report message to a moderator
|
|
|