1 |
Grant wrote: |
2 |
>>>>> I recently disabled swap and mounted /tmp on tmpfs for a netbook since |
3 |
>>>>> the SSD is so slow, and now I'm wondering if that would be a wise move |
4 |
>>>>> for all of my Gentoo systems. In what type of situation would it be a |
5 |
>>>>> bad idea? |
6 |
>>>>> |
7 |
>>>>> |
8 |
>>>> Instead of disabling swap, just make it small (like 32MB or something; |
9 |
>>>> whatever the smallest allowable partition size is). The kernel needs |
10 |
>>>> swap to operate optimally, even if it's extremely small. Just make sure |
11 |
>>>> it's there. |
12 |
>>>> |
13 |
>>>> |
14 |
>>> Hmm, on this old box I noticed swap was using more than 135,000K earlier today |
15 |
>>> as I was emerging xulrunner and ImageMagick. I think that the size of swap |
16 |
>>> is relevant to the memory size that the box in question has. Not all |
17 |
>>> machines have found their way to 2G RAM yet ... ;) |
18 |
>>> |
19 |
>>> |
20 |
>>> |
21 |
>> Don't forget that you can set swapiness too. This is set in |
22 |
>> /etc/sysctl.conf and for mine I have this: |
23 |
>> |
24 |
>> vm.swappiness = 30 |
25 |
>> |
26 |
>> The lower the number, the less chance of it using swap. If it is set to |
27 |
>> 90, it will use a lot of swap which is fine if you have little ram or a |
28 |
>> really fast drive. If it is set to 30, then it will not use swap unless |
29 |
>> it is basically out of ram. |
30 |
>> |
31 |
>> With the setting of 30, mine uses swap when compiling OOo or some other |
32 |
>> large package or if I am opening a TON of pics. Otherwise, swap is at 0 |
33 |
>> or close to it even after being up a long time. I have 2Gbs here tho. |
34 |
>> Your mileage may vary. |
35 |
>> |
36 |
>> Dale |
37 |
>> |
38 |
> |
39 |
> Thanks Dale. Should "vm.swappiness = 30" work well on all systems? |
40 |
> My Gentoo systems have vastly different specs and duties so I love |
41 |
> tweaks that always improve things. It sounds like /tmp on tmpfs is |
42 |
> one of those. |
43 |
> |
44 |
> - Grant |
45 |
> |
46 |
> |
47 |
> |
48 |
|
49 |
I'm on x86 and I really don't know where the vm part came from. It |
50 |
could have been me that put it there but I think it may have gotten |
51 |
updated somewhere along the way. I'm not sure what would update that |
52 |
tho. May be worth a google for your arch and just swappiness and see |
53 |
what else can be in front of it. |
54 |
|
55 |
I used to have it set to 70 when I only had 512MBs of ram. It would use |
56 |
swap pretty regular, even just for caching stuff. So, the setting does |
57 |
work for sure. If you wanted it to use swap only to prevent the system |
58 |
from crashing, I would assume you could set it to 10 or something like |
59 |
that. If you have a really fast drive, SATA or something, then you |
60 |
could set it to 90 and let it use swap all it wants. |
61 |
|
62 |
Dale |
63 |
|
64 |
:-) :-) |