1 |
On 13/06/2013 10:14, Grant wrote: |
2 |
> I'm trying to maximize the number of servers I can run on my machine |
3 |
> without running out of physical RAM. I noticed something strange when |
4 |
> comparing top and free statistics: |
5 |
> |
6 |
> top says each PID associated with a particular server has a RES of |
7 |
> about 100M. Does that mean each running instance of that server |
8 |
> reserves 100MB? Since there are 20 of these servers running, this |
9 |
> seems contradictory to the output from free which indicates less than |
10 |
> 1GB used -/+ buffers/cache. |
11 |
|
12 |
RES does not mean reserved. It means resident. |
13 |
|
14 |
"man top" and searhc for RES for more info |
15 |
|
16 |
> |
17 |
> Is there any way to monitor RAM usage over time to see how close I'm |
18 |
> getting to using all of my physical RAM? |
19 |
|
20 |
|
21 |
Not really if instantaneous values is what you are looking for. |
22 |
|
23 |
All tools that purport to display "memory used" and "cpu load" values on |
24 |
an instantaneous basis basically lie through their teeth, and it's a |
25 |
fallacy to try and interpret such results to gain anything meaningful. |
26 |
|
27 |
It can't be any other way actually - memory usage can change |
28 |
dramatically 10,000 times a second, and that is precisely what the |
29 |
computer is designed to do, and to do it fast, and to do it invisibly. |
30 |
|
31 |
"using all of my physical RAM" is also a concept that really makes no |
32 |
sense in any meaningful way. You can't treat it like eg the amount of |
33 |
water left in a bottle. All of memory is always in use all of the time, |
34 |
it's always doing *something*. Most of it is under the kernel's control |
35 |
and is used for caching, and the kernel is free to move things around as |
36 |
it sees fit. Memory is also shared, you can easily have a situation |
37 |
where 10 apps each have access to Y megs of RAM and total memory in use |
38 |
is still only a little bit more than Y |
39 |
|
40 |
The best you can really do is keep an eye on what free says, and to |
41 |
graph the trend. |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
-- |
47 |
Alan McKinnon |
48 |
alan.mckinnon@×××××.com |