1 |
Redouane Boumghar wrote: |
2 |
> Hello all, |
3 |
> |
4 |
> Grant wrote: |
5 |
>> Also, I've noticed in top that when my server's 2GB of memory is |
6 |
>> filled, it uses a small amount of swap (~24k) before it frees some up. |
7 |
>> The "Swap: 24k" then remains. Is that normal? |
8 |
> |
9 |
> Yes I have also notice that after a heavy ram use I get this tiny |
10 |
> space used on my swap. And it remains even after my ram has been half |
11 |
> freed. |
12 |
> My box has 1GB of ram and the small amount I sometime get on swap is |
13 |
> 164KB and it can stay like that for 2 weeks, until i reboot. |
14 |
> But I assume rebooting is not a great solution for a server :=) |
15 |
> |
16 |
> Writing to disk is too expensive as Pablo Antonio suggested, so once swap |
17 |
> has been used it won't be cleaned until next use, but how to be sure |
18 |
> it is cleaned at next use ? |
19 |
|
20 |
>From /etc/conf.d/rc: |
21 |
|
22 |
> # RC_SWAP_ERASE controls erasing of swap partitions at shutdown. |
23 |
> # Useful for all those paranoid peeps to nuke their memory. |
24 |
> |
25 |
> RC_SWAP_ERASE="yes" |
26 |
|
27 |
|
28 |
|
29 |
> |
30 |
> Anyway if you want to have stats on the usage of your memory you can |
31 |
> use 'free' |
32 |
> but for a long-period log I would recommend 'vmstat' as it puts |
33 |
> everything on one line so you could gnuplot it later. |
34 |
> |
35 |
> vmstat | grep -v [a-z] >> memory.log |
36 |
> |
37 |
> |
38 |
> As Daniel Iliev suggested, there is the configurable sysctl for swap |
39 |
> control solutions. The variables vm.swappiness and the |
40 |
> vm.swap_token_timeout which |
41 |
> control the "trashing behavior". I didn't really find much info on |
42 |
> vm.swap_token_timeout. |
43 |
> |
44 |
> The man is not very extensive. |
45 |
> Has Anyone more info on configuration of the file /etc/sysctl.conf ? |
46 |
> especially for : |
47 |
> vm.swappiness |
48 |
> vm.swap_token_timeout |
49 |
|
50 |
You can put this in your /etc/sysctl.conf file: |
51 |
|
52 |
> vm.swappiness = 30 |
53 |
|
54 |
That is what I have in mine. It does work though. I have changed and |
55 |
you can see the difference. |
56 |
|
57 |
> |
58 |
> If we get a solution or just some more info, |
59 |
> it would be nice to have a wiki page about it, wouldn't it ? ;) |
60 |
> |
61 |
> Have a Good Day, |
62 |
> Red. |
63 |
> |
64 |
> ----------------------------------------+ |
65 |
> MAGELLIUM @ http://www.magellium.fr/ |
66 |
> ----------------------------------------+ |
67 |
> |
68 |
|
69 |
-- |
70 |
gentoo-user@g.o mailing list |