Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2011
    Posts
    235

    Xen memory usage?

    Hi Guys,

    I've a 192MB Xen, and from day one (after activation), the memory usage was hovering around 170 - 180MB - even though there's nothing running on it.

    But the server is responsive enough (I had a go at compiling some stuff - memory usage level appears to be the same).

    But I'm curious to find out why so I submitted a ticket and received a reply that a level3 tech person will look into later.

    When I logged in a few minutes ago to check (top -i) - memory usage has dropped to around 59MB.

    Code:
    Tasks:  45 total,   2 running,  43 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.0%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.3%st
    Mem:    196608k total,    59840k used,   136768k free,     7572k buffers
    Swap:   196600k total,       48k used,   196552k free,    13104k cached
    ps aux (current) shows:
    Code:
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.3   2160   716 ?        Ss   Jun15   0:00 init [3]
    root         2  0.0  0.0      0     0 ?        S<   Jun15   0:00 [migration/0]
    root         3  0.0  0.0      0     0 ?        SN   Jun15   0:00 [ksoftirqd/0]
    root         4  0.0  0.0      0     0 ?        S<   Jun15   0:00 [watchdog/0]
    root         5  0.0  0.0      0     0 ?        S<   Jun15   0:00 [events/0]
    root         6  0.0  0.0      0     0 ?        S<   Jun15   0:00 [khelper]
    root         7  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kthread]
    root         9  0.0  0.0      0     0 ?        S<   Jun15   0:00 [xenwatch]
    root        10  0.0  0.0      0     0 ?        S<   Jun15   0:00 [xenbus]
    root        17  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kblockd/0]
    root        18  0.0  0.0      0     0 ?        S<   Jun15   0:00 [cqueue/0]
    root        22  0.0  0.0      0     0 ?        S<   Jun15   0:00 [khubd]
    root        24  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kseriod]
    root        84  0.0  0.0      0     0 ?        S    Jun15   0:00 [khungtaskd]
    root        87  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kswapd0]
    root        88  0.0  0.0      0     0 ?        S<   Jun15   0:00 [aio/0]
    root       218  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kpsmoused]
    root       243  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kstriped]
    root       254  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kjournald]
    root       306  0.0  0.3   2356   612 ?        S<s  Jun15   0:00 /sbin/udevd -d
    root       607  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kmpathd/0]
    root       608  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kmpath_handlerd]
    root       689  0.0  0.0      0     0 ?        S<   Jun15   0:00 [iscsi_eh]
    root       736  0.0  0.0      0     0 ?        S<   Jun15   0:00 [ib_addr]
    root       743  0.0  0.0      0     0 ?        S<   Jun15   0:00 [ib_mcast]
    root       744  0.0  0.0      0     0 ?        S<   Jun15   0:00 [ib_inform]
    root       745  0.0  0.0      0     0 ?        S<   Jun15   0:00 [local_sa]
    root       748  0.0  0.0      0     0 ?        S<   Jun15   0:00 [iw_cm_wq]
    root       751  0.0  0.0      0     0 ?        S<   Jun15   0:00 [ib_cm/0]
    root       754  0.0  0.0      0     0 ?        S<   Jun15   0:00 [rdma_cm]
    root       769  0.0  0.2  22452   548 ?        Ssl  Jun15   0:00 brcm_iscsiuio
    root       774  0.0  0.2   3696   536 ?        Ss   Jun15   0:00 iscsid
    root       775  0.0  2.1   4152  4148 ?        S<Ls Jun15   0:00 iscsid
    root       977  0.0  0.3   1816   620 ?        Ss   Jun15   0:00 syslogd -m 0
    root       980  0.0  0.2   1764   408 ?        Ss   Jun15   0:00 klogd -x
    root       999  0.0  0.5   7204  1036 ?        Ss   Jun15   0:00 /usr/sbin/sshd
    root      1007  0.0  0.5   3332  1116 ?        Ss   Jun15   0:00 crond
    root      1112  0.0  0.5   2552  1172 ?        Ss   Jun15   0:00 /bin/sh
    root      1114  0.0  0.0      0     0 ?        S<   Jun15   0:00 [kauditd]
    root      1609  0.0  0.0      0     0 ?        S    11:34   0:00 [pdflush]
    root      1610  0.0  0.0      0     0 ?        S    11:34   0:00 [pdflush]
    root      1636  0.0  1.4  10056  2892 ?        Ss   21:39   0:00 sshd: vpswing [priv]
    vpswing   1638  0.0  0.8  10056  1636 ?        S    21:39   0:00 sshd: vpswing@pts/0
    vpswing   1639  0.0  0.6   2552  1332 pts/0    Ss   21:39   0:00 -bash
    vpswing   1656  0.0  0.4   2272   824 pts/0    R+   21:49   0:00 ps aux
    I did a "diff" to compare the current ps aux with a prev. report to see what different processes were killed. Results:


    Code:
    results from high mem. usage
    
    15,16d14
    < root,85,0.0,0.0,0,0,?,S,Jun15,0:00,[pdflush]
    < root,86,0.0,0.0,0,0,?,S,Jun15,0:00,[pdflush]
    42,47c40,45
    < root,1556,0.0,1.4,10056,2888,?,Ss,10:44,0:00,sshd:,vpswing,[priv]
    < vpswing,1558,0.0,0.8,10212,1660,?,S,10:44,0:00,sshd:,vpswing@pts/0
    < vpswing,1559,0.0,0.6,2552,1356,pts/0,Ss,10:44,0:00,-bash
    < root,1576,0.0,0.6,2940,1216,pts/0,S,10:49,0:00,su
    < root,1577,0.0,0.6,2660,1312,pts/0,S,10:49,0:00,bash
    < root,1603,0.0,0.4,2272,824,pts/0,R+,11:18,0:00,ps,aux
    
    ---
    results from low mem. usage:
    
    > root,1609,0.0,0.0,0,0,?,S,11:34,0:00,[pdflush]
    > root,1610,0.0,0.0,0,0,?,S,11:34,0:00,[pdflush]
    > root,1636,0.0,1.4,10056,2892,?,Ss,21:39,0:00,sshd:,vpswing,[priv]
    > vpswing,1638,0.0,0.8,10056,1636,?,S,21:39,0:00,sshd:,vpswing@pts/0
    > vpswing,1639,0.0,0.6,2552,1332,pts/0,Ss,21:39,0:00,-bash
    > vpswing,1656,0.0,0.4,2272,824,pts/0,R+,21:49,0:00,ps,aux

    Any clues as to what is happening here?

    Many thanks!
    Adrian

  2. #2
    Join Date
    Jan 2010
    Location
    San Francisco
    Posts
    1,800
    http://www.linuxatemyram.com/

    It's simply caching.

  3. #3
    I think it's just that Xens tend to use a lot of memory from the get-go. I'm not sure though; you might want to check up on that .
    My personal blog -- rubiverse.net

  4. #4
    Join Date
    May 2009
    Posts
    264
    Quote Originally Posted by WickedFactor View Post
    http://www.linuxatemyram.com/

    It's simply caching.
    Haha, I like that site. I'll have to save that link. Thanks!

  5. #5
    Join Date
    Apr 2011
    Posts
    235
    Quote Originally Posted by WickedFactor View Post
    http://www.linuxatemyram.com/

    It's simply caching.
    Wow ... ok, thanks for that! A relief to hear :-)

    But why does it stopped using "disk-caching" now?

    free -m shows:

    Code:
                 total       used       free     shared    buffers     cached
    Mem:           192         59        132          0          8         12
    -/+ buffers/cache:         38        153
    Swap:          191          0        191
    Something must have changed on the system to cause that right?

    On another note, I have another OpenVZ (also 192MB RAM), and from day 1, it shows:

    Code:
                 total       used       free     shared    buffers     cached
    Mem:           192         11        180          0          0          0
    -/+ buffers/cache:         11        180
    Swap:            0          0          0
    Does it mean it does not do disk-caching?

    And, does disk-caching makes the VPS faster?


    Many thanks!
    Adrian

  6. #6
    Join Date
    Jun 2010
    Location
    Northern Virginia
    Posts
    2,201
    Quote Originally Posted by WickedFactor View Post
    http://www.linuxatemyram.com/

    It's simply caching.
    Great link!

  7. #7
    Join Date
    Jan 2010
    Location
    San Francisco
    Posts
    1,800
    Quote Originally Posted by vpswing View Post
    Wow ... ok, thanks for that! A relief to hear :-)

    But why does it stopped using "disk-caching" now?

    free -m shows:

    Code:
                 total       used       free     shared    buffers     cached
    Mem:           192         59        132          0          8         12
    -/+ buffers/cache:         38        153
    Swap:          191          0        191
    Something must have changed on the system to cause that right?
    I'm not positive how linux caches the disk, but I do know when my Xen VPS actually uses more memory, some of the memory that's used for disk caching is freed up, but as the system sits idle, the amount of memory disk caching uses comes back.

    Quote Originally Posted by vpswing View Post
    On another note, I have another OpenVZ (also 192MB RAM), and from day 1, it shows:

    Code:
                 total       used       free     shared    buffers     cached
    Mem:           192         11        180          0          0          0
    -/+ buffers/cache:         11        180
    Swap:            0          0          0
    Does it mean it does not do disk-caching?

    And, does disk-caching makes the VPS faster?


    Many thanks!
    Adrian
    OpenVZ VPSes don't show memory used for disk caching, however, the VPS node as a whole still caches the disk. It's a part of linux.

    Xen behaves more like a dedicated server, hence why you're seeing disk caching. This isn't to say that Xen is faster than OpenVZ because of disk caching. Caching still happens, you just don't see it within an individual OpenVZ VPS.

  8. #8
    Join Date
    Jul 2007
    Location
    Virginia
    Posts
    1,314
    Unused RAM is wasted RAM .
    Linux is nice enough to take care of that for you.
    ~ @PreetamJinka

  9. #9
    Join Date
    Apr 2011
    Posts
    235
    Quote Originally Posted by WickedFactor View Post

    Xen behaves more like a dedicated server, hence why you're seeing disk caching. This isn't to say that Xen is faster than OpenVZ because of disk caching. Caching still happens, you just don't see it within an individual OpenVZ VPS.
    Thanks Tinderhost, appreciate the explanation!

    cheers!

  10. #10
    Join Date
    Jan 2010
    Location
    San Francisco
    Posts
    1,800
    No problem.

  11. #11
    Join Date
    Mar 2005
    Location
    Labrador, Canada
    Posts
    988
    Quote Originally Posted by WickedFactor View Post
    OpenVZ VPSes don't show memory used for disk caching, however, the VPS node as a whole still caches the disk. It's a part of linux.
    That's assuming the host node has memory available for caching. On a crowded OpenVZ node there could be very little memory available....

    With Xen you know exactly how much memory is being used for cache. With OpenVZ you can only hope that some of your stuff is being cached.

  12. #12
    Join Date
    Apr 2011
    Posts
    235
    Hi Sleddog,

    With Xen you know exactly how much memory is being used for cache. With OpenVZ you can only hope that some of your stuff is being cached.
    Thanks for the insight! No wonder so many people speaks highly of Xen.
    But why do some folks say all things being equal (e.g. high powered server, not oversold), OpenVZ outperforms Xen?

  13. #13
    Join Date
    Mar 2005
    Location
    Labrador, Canada
    Posts
    988
    Quote Originally Posted by vpswing View Post
    But why do some folks say all things being equal (e.g. high powered server, not oversold), OpenVZ outperforms Xen?
    Probably because that's what benchmarks show, when the benchmarks are run in a very controlled environment to eliminate external factors.

    But for the real world, I'll take Xen

Similar Threads

  1. what software for monitor all the domain CPU usage? memory usage?
    By hehejx in forum Hosting Software and Control Panels
    Replies: 1
    Last Post: 06-26-2010, 05:15 AM
  2. Memory Usage for XEN vs. VOZ
    By xkey in forum Hosting Security and Technology
    Replies: 0
    Last Post: 06-23-2009, 08:12 PM
  3. High Dom0 memory usage on xen
    By Chris Drew in forum Hosting Security and Technology
    Replies: 0
    Last Post: 11-29-2008, 12:02 PM
  4. Server Load/CPU Usage/Memory Usage
    By -YaYa- in forum Running a Web Hosting Business
    Replies: 18
    Last Post: 02-11-2006, 12:43 AM
  5. server load, cpu usage, memory usage
    By Nullified in forum Programming Discussion
    Replies: 4
    Last Post: 12-31-2004, 08:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •