Wednesday, April 13, 2011

Memory overhead

Talking about computers the more the better is usual, but this is not true all the time. By example, look at the amount of memory and load in bigservr; this server has 64 gigabytes of memory but is used just 3 gigabytes, and even if there are no running processes and the CPU usage is almost zero the load average is somewhat high. In comparison, smallsrv is busier and even having used swap memory the load average is lower than in bigservr.

The management of hardware by the Linux kernel requires resources, and in order to manage a lot of memory the kernel requires ... a lot of memory structures. Therefore, if you aren't going to use a lot of memory it would be better (and cheaper) to install just the memory you need.

myuser@bigservr> top

top - 08:50:32 up 6 days, 13:00, 4 users, load average: 0.71, 0.74, 0.66
Tasks: 272 total, 1 running, 271 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.8%us, 0.1%sy, 0.0%ni, 99.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 65791000k total, 3227812k used, 62563188k free, 309716k buffers
Swap: 5406712k total, 0k used, 5406712k free, 2649252k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10768 root 15 0 16420 2456 2124 S 0.3 0.0 0:39.00 cmaeventd
22241 myuser 15 0 2336 1136 800 R 0.3 0.0 0:01.14 top
1 root 15 0 2072 616 532 S 0.0 0.0 0:08.29 init
2 root RT -5 0 0 0 S 0.0 0.0 0:01.17 migration/0
3 root 39 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT -5 0 0 0 S 0.0 0.0 0:01.44 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.07 ksoftirqd/1
7 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
8 root RT -5 0 0 0 S 0.0 0.0 0:01.01 migration/2
9 root 34 19 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/2
10 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/2
11 root RT -5 0 0 0 S 0.0 0.0 0:01.72 migration/3

root@smallsrv:~# top

top - 08:51:20 up 29 min, 6 users, load average: 0.16, 0.21, 0.46
Tasks: 184 total, 2 running, 182 sleeping, 0 stopped, 0 zombie
Cpu(s): 7.0%us, 12.3%sy, 0.0%ni, 79.3%id, 1.3%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1016864k total, 987644k used, 29220k free, 44384k buffers
Swap: 2980016k total, 204780k used, 2775236k free, 604592k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2599 myuser 10 -10 271m 186m 177m S 9.6 18.8 2:55.94 vmware-vmx
2377 myuser 20 0 388m 103m 19m S 4.3 10.4 0:50.69 firefox-bin
1030 root 20 0 105m 20m 9428 S 3.0 2.1 1:00.57 Xorg
2435 myuser 20 0 73624 13m 9.9m S 1.3 1.4 0:15.40 plugin-containe
3479 root 20 0 2472 1196 880 R 0.7 0.1 0:00.06 top
16 root 15 -5 0 0 0 S 0.3 0.0 0:00.39 ata/0
2028 myuser 20 0 110m 10m 5832 S 0.3 1.1 0:12.17 compiz.real
2206 myuser 20 0 113m 11m 8324 S 0.3 1.2 0:04.71 gnome-terminal
2938 root 0 -20 0 0 0 R 0.3 0.0 0:08.41 vmware-rtc
1 root 20 0 2532 1420 1096 S 0.0 0.1 0:00.98 init
2 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
4 root 15 -5 0 0 0 S 0.0 0.0 0:00.09 ksoftirqd/0
5 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
6 root 15 -5 0 0 0 S 0.0 0.0 0:00.02 events/0
7 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 cpuset
8 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 khelper

No comments:

Post a Comment