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