OpenVZ Forum


Home » General » Discussions » Memory Issue size
icon4.gif  Memory Issue size [message #1547] Mon, 13 February 2006 04:50 Go to next message
jbond007 is currently offline  jbond007
Messages: 78
Registered: January 2006
Location: Miami
Member
Embarassed hi all i found i security issue
the command free inside of vps show all memory from server
plase OpenVZ devel find diferent way to work in MB not, sample
to add memory size is Hard
--vmguarpages=\"64288:2147483647\" --save
how can setup memory easy way MB
how i check vzmemcheck in MB only
Help me Thank you
Max
Very Happy OpenVZ Addiction
Re: Memory Issue size [message #1550 is a reply to message #1547] Mon, 13 February 2006 07:29 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

1. free output will be virtualized soon. But there are no security implications of this.
http://bugzilla.openvz.org/show_bug.cgi?id=102

2. your feature request for setting params in MBs added to bugzilla. But in configs I suppose it will be still written in old pages/bytes values for backward compatibility.
http://bugzilla.openvz.org/show_bug.cgi?id=101


http://static.openvz.org/userbars/openvz-developer.png
Re: Memory Issue size [message #1580 is a reply to message #1547] Mon, 13 February 2006 23:07 Go to previous messageGo to next message
devnu11 is currently offline  devnu11
Messages: 64
Registered: September 2005
Location: USA
Member

This would certainly make things less complicating/confusing. I hope progress is made on this as it would be a welcomed feature.

Just Because You Have One, Doesn't Mean You Have To Be One!
Re: Memory Issue size [message #1653 is a reply to message #1580] Sun, 19 February 2006 05:53 Go to previous messageGo to next message
barmaley is currently offline  barmaley
Messages: 5
Registered: September 2005
Location: Marietta, GA
Junior Member
--vmguarpages $((512*256)):$((1024*256)) is going to
send the barrier to 512MB and the limit to 1024MB
Re: Memory Issue size [message #1660 is a reply to message #1547] Sun, 19 February 2006 09:31 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
sorry but it does not work - for me.

I tried to set the limit and the barrier to 128MB.

root:~# vzctl set 4 --privvmpages 32768:32768 --oomguarpages 32768:32768 --physpages 32768:32768 --vmguarpages 32768:32768 --save
Saved parameters for VPS 4
root:~# vzctl start 4    
Starting VPS ...
VPS is mounted
Adding IP address(es): 192.168.0.13
Setting CPU units: 1000
Set hostname: myhostname
File resolv.conf was modified
Setting quota ugidlimit: 99999999
VPS start in progress...
root:~# ssh 192.168.0.13
Password: 
Last login: Sun Feb 19 09:26:03 2006 from 192.168.0.10
myhostname:~# perl -e '$a="a";for(;;) {$a.=$a; print "allocated ".int(length($a)/1024/1024)."MB\n";}'  
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 0MB
allocated 1MB
allocated 2MB
allocated 4MB
allocated 8MB
allocated 16MB
allocated 32MB
allocated 64MB
allocated 128MB
allocated 256MB
allocated 512MB
allocated 1024MB
Out of memory!


I don't understand that...

Stefan
Re: Memory Issue size [message #1661 is a reply to message #1547] Sun, 19 February 2006 09:44 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
OK - i found some strange things...

1. as you can see, i can still allocate 1GB
2. a cat cat /proc/user_beancounters shows me failures at privvmpages failcnt=4 - but the script can work
3. on the host machine i see in syslog:
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Uncharging too much 1 h 0, res unused_privvmpages ub 4
Fatal resource shortage: kmemsize, UB 4.
Uncharging too much 65610 h 54827, res unused_privvmpages ub 4
Uncharging too much 3 h 0, res unused_privvmpages ub 4


What does that mean?

4. if i set kmemsize to 655360 the script can only allocate 128MB - any idea?


Re: Memory Issue size [message #1664 is a reply to message #1660] Sun, 19 February 2006 10:03 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

1. why have you set ugidlimit to 99999999? this is quite huge and I suppose allows DoS from your VPs.
Do you really have 99millions of users and groups in your VPS???

2. I suppose string lenght has nothing to do with real memory allocated by perl.

Why? because:
- perl allocates lot's of memory on his own.
- AFAIK it uses garbarge collection

You can check it with RSS memory which is shown by top and ps.
Also, as barmaley pointed to you, all these parameters limit address space. Which is usually bigger than a set of allocated pages by application. So, for example, if perl mmap()'s some big file in it's address space it consumes privvmpages.



http://static.openvz.org/userbars/openvz-developer.png
Re: Memory Issue size [message #1665 is a reply to message #1547] Sun, 19 February 2006 10:14 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
I've not checked parameters like guid and so on - it is only a test machine and does not matter.

Ähm the length of the string is def. allocated - i've also checked it by top - i can see, that perl does allocate 45% of RAM (next time top refresh the process is mostly killed cause of out of memory and the fact that the sting is always doubled).

But i think we'll discuss that in my own thread here:
http://forum.openvz.org/index.php?t=msg&goto=1666
sorry for my cross posting.

[Updated on: Sun, 19 February 2006 10:28]

Report message to a moderator

Re: Memory Issue size [message #1667 is a reply to message #1665] Sun, 19 February 2006 10:31 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

disaster,

what VPS OS do you use?
I will recheck it tomorrow with the script you supplied for a string, but it looks quite correct.

Perl maps too much of an address space. This is normal.

Please, note, privvmpages and vmguarpages are not a real amount of _physical_ memory. This is size of an allocated _address_ _space_, which can _potentially_ allocate the pages. This is why, usual applications can report less RAM available, because address space is used for glibc/elfs/files etc.


http://static.openvz.org/userbars/openvz-developer.png
Re: Memory Issue size [message #1669 is a reply to message #1547] Sun, 19 February 2006 11:20 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
You have read my last posting at?:
http://forum.openvz.org/index.php?t=msg&th=293

> what VPS OS do you use?

Both the Sstem and the VPS OS are Debian 3.1. (I'll try it with another image in a few hours)

Quote:

Please, note, privvmpages and vmguarpages are not a real amount of _physical_ memory. This is size of an allocated _address_ _space_, which can _potentially_ allocate the pages. This is why, usual applications can report less RAM available, because address space is used for glibc/elfs/files etc.


I know that. But this should result in a stop of a script earlier and not later.

I can eat up all mem with a simple perl script - and the mem is really eaten up as you can see in top - no other process can use the ram and the system start swapping...

Kernel is a 2.6.0 self build with the latest patch and the patch from the bugzilla for irq.c.

That could not be right...

Thanks for your help.

[Updated on: Sun, 19 February 2006 11:25]

Report message to a moderator

Re: Memory Issue size [message #1670 is a reply to message #1547] Sun, 19 February 2006 12:36 Go to previous messageGo to next message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
OK - you have posted in this thread so i do it too Smile

I've done some more testing. If i allocate within a c script - everthing works fine - i cannot allocate more than 115MB the rest will be the system. vzmemcheck alos reports that.

If i run the perl script AND vzmemcheck it looks like this: Shocked Shocked

VPSID LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc 
   util commit util   util  commit  util  commit  limit 
4  0.76 13.95 359.34 359.34 141.95 361.83 141.95 141.95 


You see allocation is more than limit and more than commit...

There must be a bug.

Stefan

[Updated on: Sun, 19 February 2006 12:37]

Report message to a moderator

Re: Memory Issue size [message #1672 is a reply to message #1547] Sun, 19 February 2006 13:03 Go to previous message
disaster is currently offline  disaster
Messages: 158
Registered: February 2006
Senior Member
I've now tested Kernel 2.6.15 with the beta Patch - there it WORKS!!! I'm not able to allocate more that 115MB with perl - but the fairscheduler does not work Sad

So i think we must wait for fairscheduler 2.6.15 or for a patch for 2.6.8 ... Sad

Stefan
Previous Topic: Anyone know how to use Samba as PDC in a VPS?
Next Topic: Memory Issue Inside Of Vps see all Memory from server host
Goto Forum:
  


Current Time: Mon Nov 11 11:45:35 GMT 2024

Total time taken to generate the page: 0.04968 seconds