Top.Mail.Ru
? ?

Previous Entry | Next Entry

news from the VSwap front

I have added vswap confguration samples to vzctl git. Basically, you set physpages and swappages and leave every other beancounter at unlimited. For example, this is how ve-vswap-256m-conf.sample looks like:

# UBC parameters (in form of barrier:limit)
PHYSPAGES="0:256M"
SWAPPAGES="0:512M"
KMEMSIZE="unlimited"
LOCKEDPAGES="unlimited"
PRIVVMPAGES="unlimited"
SHMPAGES="unlimited"
NUMPROC="unlimited"
VMGUARPAGES="unlimited"
OOMGUARPAGES="unlimited"
NUMTCPSOCK="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
TCPSNDBUF="unlimited"
TCPRCVBUF="unlimited"
OTHERSOCKBUF="unlimited"
DGRAMRCVBUF="unlimited"
NUMOTHERSOCK="unlimited"
DCACHESIZE="unlimited"
NUMFILE="unlimited"
NUMIPTENT="unlimited"

# Disk quota parameters (in form of softlimit:hardlimit)
DISKSPACE="1G"
DISKINODES="200000"
QUOTATIME="0"

# CPU fair scheduler parameter
CPUUNITS="1000"

As you can see, physpages (ie RAM size) is set to 256 megabytes, while swappages (ie swap size) is set to 512 megabytes, all the other beancounters are unlimited. Wow, it's never been easier to configure your containers!

Now, we can utilize this stuff using RHEL6 based kernel. This is what we see from inside the container:

[root@localhost ~]# vzctl enter 103
entered into CT 103
[root@localhost /]# free
             total       used       free     shared    buffers     cached
Mem:        262144      23936     238208          0          0      10968
-/+ buffers/cache:      12968     249176
Swap:       524288          0     524288

[root@localhost /]# cat /proc/user_beancounters 
Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
      103:  kmemsize                  4722976              4853726  9223372036854775807  9223372036854775807                    0
            lockedpages                     0                    0  9223372036854775807  9223372036854775807                    0
            privvmpages                  4296                13875  9223372036854775807  9223372036854775807                    0
            shmpages                       31                   31  9223372036854775807  9223372036854775807                    0
            dummy                           0                    0                    0                    0                    0
            numproc                        33                   33  9223372036854775807  9223372036854775807                    0
            physpages                    5984                 5985                    0                65536                    0
            vmguarpages                     0                    0  9223372036854775807  9223372036854775807                    0
            oomguarpages                 2696                 2696  9223372036854775807  9223372036854775807                    0
            numtcpsock                      4                    4  9223372036854775807  9223372036854775807                    0
            numflock                        5                    6  9223372036854775807  9223372036854775807                    0
            numpty                          1                    1  9223372036854775807  9223372036854775807                    0
            numsiginfo                     12                   18  9223372036854775807  9223372036854775807                    0
            tcpsndbuf                   69760                    0  9223372036854775807  9223372036854775807                    0
            tcprcvbuf                   65536                    0  9223372036854775807  9223372036854775807                    0
            othersockbuf                 2312                10768  9223372036854775807  9223372036854775807                    0
            dgramrcvbuf                     0                    0  9223372036854775807  9223372036854775807                    0
            numothersock                   51                   53  9223372036854775807  9223372036854775807                    0
            dcachesize                1172451              1172451  9223372036854775807  9223372036854775807                    0
            numfile                       370                  390  9223372036854775807  9223372036854775807                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      14                   14  9223372036854775807  9223372036854775807                    0


[root@localhost /]# cat /proc/meminfo 
MemTotal:         262144 kB
MemFree:          238208 kB
Cached:            10968 kB
Active:            16956 kB
Inactive:           1384 kB
Active(anon):       6352 kB
Inactive(anon):     1020 kB
Active(file):      10604 kB
Inactive(file):      364 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:        524288 kB
SwapFree:         524288 kB
Dirty:                 0 kB
AnonPages:          7364 kB
Mapped:             3416 kB
Shmem:               124 kB
Slab:               4012 kB
SReclaimable:       1088 kB
SUnreclaim:         2924 kB

Comments

( 7 comments — Leave a comment )
dowdle
Jan. 26th, 2011 11:31 pm (UTC)
Giving the RHEL6 kernel a try
I just installed RHEL6 and got the new RHEL6-testing OpenVZ kernel installed. Seems to working great so far. I used your sample Vswap config as a basis for my own configs and cool... like... it works. :)

So, I can see how adding Vswap might change the need/want the memory related parameters to unlimited... but what about everything else? Why would I want to set numproc to unlimited? I assume that the non-memory related parameters are still functional... right?

I plan on using this in a class starting next week and give each student their own container... so hopefully it'll get a good testing.

I tried installing Scientific Linux 6 beta 2 but the install media griped about missing or bad packages... and I don't think I had bad media so I gave up on it. I hope CentOS 6 comes out sometime next month. In the meantime, luckily I had a free RHEL entitlement. We do have a number of RHEL systems but usually not any extras for playing with.
k001
Jan. 27th, 2011 09:11 am (UTC)
Re: Giving the RHEL6 kernel a try
> I assume that the non-memory related parameters
> are still functional... right?

All the parameters are functional (e.g. privvmpages, too) and you can definitely use those. The idea is that you are not *required* to configure those, since physpages and swappages already gives you enough protection. In fact it's not quite true in test006 kernel yet (for example, kernel memory is not limited unless you explicitly set kmemsize) -- there are more fixes and improvements coming along the way.

Thanks for testing this stuff! :)
(Anonymous)
Feb. 11th, 2011 01:24 pm (UTC)
didnt work here
Hey,

i was trying this. It's showing the swap correctly, however, the ram amount (by just setting physpages) is displayed wrongly. Instead of using just 256M or 512M it's using the whole amount of RAM in the HN here.

total used free shared buffers cached
Mem: 3925 302 3623 0 0 0
-/+ buffers/cache: 302 3623
Swap: 512 0 512

I have to use privvmpages and set it to 256M:256M to get:

total used free shared buffers cached
Mem: 256 12 243 0 0 0
-/+ buffers/cache: 12 243
Swap: 1024 0 1024

(both times free -m, different VEs, one with 512M swap, one with 1G swap). Probably i'm doing something wrong. The used Kernel is 2.6.32 (with openvz patches applied) and vzctl i compiled from git.

/proc/user_beancounters for the VE where just setting physpages and swappages (and everything else to unlimited) looks like this:

101: kmemsize 837053 918135 9223372036854775807 9223372036854775807 0
lockedpages 0 6 9223372036854775807 9223372036854775807 0
privvmpages 73428 81582 9223372036854775807 9223372036854775807 0
shmpages 3901 3916 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numproc 60 116 9223372036854775807 9223372036854775807 0
physpages 34015 40915 0 65536 0
vmguarpages 0 0 9223372036854775807 9223372036854775807 0
oomguarpages 34015 40915 9223372036854775807 9223372036854775807 0
numtcpsock 27 33 9223372036854775807 9223372036854775807 0
numflock 27 29 9223372036854775807 9223372036854775807 0
numpty 3 4 9223372036854775807 9223372036854775807 0
numsiginfo 0 18 9223372036854775807 9223372036854775807 0
tcpsndbuf 473192 850464 9223372036854775807 9223372036854775807 0
tcprcvbuf 509816 591736 9223372036854775807 9223372036854775807 0
othersockbuf 242232 297760 9223372036854775807 9223372036854775807 0
dgramrcvbuf 0 4360 9223372036854775807 9223372036854775807 0
numothersock 168 172 9223372036854775807 9223372036854775807 0
dcachesize 918687 931602 9223372036854775807 9223372036854775807 0
numfile 1773 2529 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numiptent 20 20 9223372036854775807 9223372036854775807 0

k001
Feb. 11th, 2011 01:28 pm (UTC)
Re: didnt work here
This report doesn't make much sense w/o specifying kernel and vzctl version you have used. More to say, livejournal is not the best place for filing bugs — please use bugzilla.openvz.org
(Anonymous)
Feb. 11th, 2011 01:35 pm (UTC)
Re: didnt work here
will do so, sorry - however, i've shown the versions :)
k001
Feb. 11th, 2011 01:40 pm (UTC)
Re: didnt work here
> however, i've shown the versions :)

Well, not really...

> The used Kernel is 2.6.32 (with openvz patches applied)

For 2.6.32, we have two branches -- rhel6 and 2.6.32. vswap is only supported by rhel6.

For each branch, we have versions; for example, latest rhel6 is 042test007.1.
(Anonymous)
Feb. 11th, 2011 09:34 pm (UTC)
Re: didnt work here
k, sorry, i used the wrong branch - Works fine, good work!
( 7 comments — Leave a comment )

Latest Month

July 2016
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Comments

Powered by LiveJournal.com
Designed by Tiffany Chow