1 |
On 1/17/2011 4:23 PM, Grant wrote: |
2 |
>> I think the idea is never use swap if possible, but in a case where |
3 |
>> you don't have swap space or run out of swap space I think it's still |
4 |
>> possible to lose data. |
5 |
> |
6 |
> Isn't swap just an extension of system memory? Isn't adding 4GB of |
7 |
> memory just as effective at preventing out-of-memory as dedicating 4GB |
8 |
> of HD space to swap? I can understand enabling swap on a laptop or |
9 |
> other system with constrained memory capacity, but doesn't it make |
10 |
> sense to disable swap and add memory on a 24GB server? |
11 |
> |
12 |
> Is swap basically a way to save money on RAM? |
13 |
|
14 |
Most users won't willingly trades 4ns data access for 13ms data access. |
15 |
I'd say swap in that situation is a way to gracefully degrade |
16 |
performance so that a user or admin can decide what to do. And yes in |
17 |
some cases that graceful part isn't. |
18 |
In my experience swap has allowed me to log in, kill runaway processes, |
19 |
then shut down the database gracefully to make sure all data was saved. |
20 |
I tend not to configure more than 2-4GB these days on servers. |
21 |
The other thing to remember is alerting on 98% RAM usage under Linux is |
22 |
a not starter because Linux will shove everything into RAM until it's |
23 |
full. However alerting on 5% swap usage does work fairly well. |
24 |
|
25 |
kashani |