OpenVZ Forum


Home » General » Support » Can't start 5 processes each allocates 1G of VIRT memory, on OpenVZ with 2GB configured RAM. (But can on non-virtual system with 2G.)
Can't start 5 processes each allocates 1G of VIRT memory, on OpenVZ with 2GB configured RAM. [message #38433] Sat, 19 December 2009 01:36 Go to next message
mriadus is currently offline  mriadus
Messages: 2
Registered: December 2009
Location: spb
Junior Member
Hello.

My laptop: 2G, linux gentoo, no swap.
OpenVZ (on big 16-CPU xeon-server): 2G, linux gentoo, no swap.

A little program for my experiment:
...
char *p = new char [ 1024 * 1024 * 500 ];
...

Compiled to "/tmp/AAAA".


Starting 5 instances on laptop:

xx@master1 ~/forge/cpp $ ps aux | grep AAAA
xx       22257  0.0  0.0 514700   856 pts/29   T    05:06   0:00 /tmp/AAAA
xx       22894  0.0  0.0 514700   852 pts/21   S+   05:06   0:00 /tmp/AAAA
xx       23200  0.0  0.0 514700   852 pts/44   S+   05:06   0:00 /tmp/AAAA
xx       23443  0.0  0.0 514700   852 pts/45   S+   05:06   0:00 /tmp/AAAA
xx       24023  0.0  0.0 514700   856 pts/56   S+   05:07   0:00 /tmp/AAAA
xx       24224  0.0  0.0 514700   852 pts/59   S+   05:07   0:00 /tmp/AAAA

(514700 = VIRT, 856 = RES)
As we can see, since am not using memory pages, it is available to allocate much more memory than we have physically.

The same experiment with OpenVZ has failed. I couldn't start more than ~2-3 instances of AAAA (limited by sum of their "VIRT"s). But ps's output for one instance of AAAA on OpenVZ is similar (in terms of VIRT and RES) to laptop's one:
xx   25554  0.0  0.0 523548  1024 pts/1    T    01:16   0:00 /tmp/AAAA

(VIRT=523548, RES=1024)

Interesting detail. Lets see to "htop" program. It has a general green "memory-meter" displaying amount of used memory, file cache etc... For laptop running one "AAAA" i can see that used memory increasing by AAAA's "RES" value (~1MB). But for OpenVZ i see increasing by ~500MB in this meter.

What parameters of OpenVZ resources limitation i should RTFM to allow processes have VIRTs like on real laptop? Need this very much. )

Thank you!
Re: Can't start 5 processes each allocates 1G of VIRT memory, on OpenVZ with 2GB configured RAM. [message #38492 is a reply to message #38433] Sat, 26 December 2009 11:29 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

sorry for delay.

Firstly, I would recommend you to pay attention to "cat /proc/user_beancounters" output. Increasing fail counters (the last column) indicate to resources that your system lack of at the moment.
To deeper investigate the issue please start with the following page.
http://wiki.openvz.org/User_beancounters
Previous Topic: VPS Container bandwidth low
Next Topic: PPP in a container question?
Goto Forum:
  


Current Time: Tue May 28 07:22:08 GMT 2024

Total time taken to generate the page: 0.01486 seconds