1 |
>> So swap isn't treated exactly like RAM. It actually has special |
2 |
>> handling in Linux which makes it beneficial to have on almost any |
3 |
>> Linux system? According to Alan, things get very bad when a Linux |
4 |
>> system hits swap. How can behavior like this be beneficial: |
5 |
>> |
6 |
>> "When a linux machine hits swap, it does so very aggressively, there |
7 |
>> is nothing nice about it at all. The entire machine slows to a |
8 |
>> painstaking crawl for easily a minute at a time while the kernel |
9 |
>> writes pages out to disk, and disk is thousands of times slower than |
10 |
>> RAM. |
11 |
>> |
12 |
>> It gets so bad that you can't even run a shell properly to try and see |
13 |
>> what's going on and kill the actual memory hog." |
14 |
>> |
15 |
>> Also, aren't you likely to wear out your hard disk sooner using swap? |
16 |
> |
17 |
> |
18 |
> 1. swap is good. Unless you have a good reason, leave it there. You do not |
19 |
> have a good reason to remove it and neither does anyone else. |
20 |
> |
21 |
> 2. Don't use the swap that you have. It's slow. It is not a replacement for |
22 |
> RAM. |
23 |
> |
24 |
> 3. If you use a little bit of swap, 100-200MB, that's fine. It's also a sign |
25 |
> you need more RAM. |
26 |
> |
27 |
> 4. If you're using all your RAM and a couple of GB of swap, you're screwed. |
28 |
> Avoid this. |
29 |
> |
30 |
> 5. Swap that you never write to or read from never needs to hit the drives. |
31 |
> If you're worried about drive wear, turn off logging. |
32 |
> |
33 |
> kashani |
34 |
|
35 |
OK, how about I enable a 512MB swap file and keep an eye on it. As |
36 |
long as I'm not using more than 200MB, I'm not suffering from disk |
37 |
swap slowdown, right? |
38 |
|
39 |
- Grant |