# Swap space recomendation

**URL:** https://forums.suse.com/t/swap-space-recomendation/26585
**Category:** SLES Configure-Administer
**Created:** [January 21, 2015, 6:11pm UTC](https://forums.suse.com/t/swap-space-recomendation/26585 "2015-01-21T18:11:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rvillafafila](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rvillafafila](https://forums.suse.com/u/rvillafafila)
#### Post date: [January 21, 2015, 6:11pm UTC](https://forums.suse.com/t/swap-space-recomendation/26585/1 "2015-01-21T18:11:46Z")

</div>

Hi,  
I’ve searched for a recomendation about swap space sizing in SLES but I haven’t found anything.  
I’m working with SLES 11 and SLES 12.  
Anyone have a recomendation about this theme?  
Thanks

---

<div class="post-metadata">

### Author: ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)
#### Post date: [January 21, 2015, 6:32pm UTC](https://forums.suse.com/t/swap-space-recomendation/26585/2 "2015-01-21T18:32:07Z")

</div>

> [@](#):
>
> On Wed 21 Jan 2015 04:14:02 PM CST, rvillafafila wrote:
> 
> Hi,  
> I’ve searched for a recomendation about swap space sizing in SLES but I  
> haven’t found anything.  
> I’m working with SLES 11 and SLES 12.  
> Anyone have a recomendation about this theme?  
> Thanks

Hi  
How much system ram? Since it’s a server your not going to  
hibernate/suspend little point in have a swap around 1~1.5 installed  
RAM.

–  
Cheers Malcolm Â°Â¿Â° LFCS, SUSE Knowledge Partner (Linux Counter #276890)  
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.32-33-default  
If you find this post helpful and are logged into the web interface,  
please show your appreciation and click on the star below… Thanks!

---

<div class="post-metadata">

### Author: ![rvillafafila](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@rvillafafila](https://forums.suse.com/u/rvillafafila)
#### Post date: [January 21, 2015, 6:42pm UTC](https://forums.suse.com/t/swap-space-recomendation/26585/3 "2015-01-21T18:42:04Z")

</div>

[QUOTE=malcolmlewis;25916]Hi  
How much system ram? Since it’s a server your not going to  
hibernate/suspend little point in have a swap around 1~1.5 installed  
RAM.

–  
Cheers Malcolm Â°Â¿Â° LFCS, SUSE Knowledge Partner (Linux Counter #276890)  
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.32-33-default  
If you find this post helpful and are logged into the web interface,  
please show your appreciation and click on the star below… Thanks![/QUOTE]

System RAM size is variable.  
The minimum size for my servers is 4 GB and the maximum is 64 GB.  
In the case of big RAM sizes I think that use 1~1.5 swap space size is a waste of disk and that’s the reason that I was searching for a recomendation.  
Thanks

---

<div class="post-metadata">

### Author: ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)
#### Post date: [January 21, 2015, 7:09pm UTC](https://forums.suse.com/t/swap-space-recomendation/26585/4 "2015-01-21T19:09:49Z")

</div>

> [@](#):
>
> On Wed 21 Jan 2015 04:44:02 PM CST, rvillafafila wrote:
> 
> malcolmlewis;25916 Wrote:[color=blue]
> 
> > Hi  
> > How much system ram? Since it’s a server your not going to  
> > hibernate/suspend little point in have a swap around 1~1.5 installed  
> > RAM.
> > 
> > –  
> > Cheers Malcolm Â°Â¿Â° LFCS, SUSE Knowledge Partner (Linux Counter  
> > #276890)  
> > SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel  
> > 3.12.32-33-default If you find this post helpful and are logged into  
> > the web interface, please show your appreciation and click on the  
> > star below… Thanks![/color]
> 
> System RAM size is variable.  
> The minimum size for my servers is 4 GB and the maximum is 64 GB.  
> In the case of big RAM sizes I think that use 1~1.5 swap space size is a  
> waste of disk and that’s the reason that I was searching for a  
> recomendation.  
> Thanks

Hi  
Well then it depends on the system load with the lower sizes of ram,  
but you can’t really tell until you monitor and see if it swaps…

I have 8GB in my systems (laptops and a SLES 12 server) I wind down the  
swappiness so it will use ram before looking to swap.

```auto
vm.swappiness=1
vm.vfs_cache_pressure=50
```

For the 4GB systems probably 1-1.5 times anything greater than 16GB I  
probably wouldn’t worry unless you have the occasion for a runaway  
process, then having swap sometimes helps to get to a system before it  
goes belly up…but again that is all based on your observations of the  
systems.

You can always add a swap ‘file’ if needed, then there is the zram  
kernel module.

–  
Cheers Malcolm Â°Â¿Â° LFCS, SUSE Knowledge Partner (Linux Counter #276890)  
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.32-33-default  
If you find this post helpful and are logged into the web interface,  
please show your appreciation and click on the star below… Thanks!

---

<div class="post-metadata">

### Author: ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)
#### Post date: [January 22, 2015, 1:27am UTC](https://forums.suse.com/t/swap-space-recomendation/26585/5 "2015-01-22T01:27:29Z")

</div>

Yeah, and in my own systems I basically set swap at 2 GiB regardless. My  
laptop, this time, has as much as it has RAM for hibernate reasons, but  
for the last five years or so I ran without swap at all. It’s not  
necessary, and my personal experience with it is that at best it delays  
the inevitable. If you have a runaway process (vs. a slow leak) then  
consuming however much swap you have is not going to take very long, and  
in the meantime your system’s performance will be terrible. In most cases  
I’d rather have the process die so that the system still responds and I  
can start investigating why the process died. The alternative is a lot of  
terrible performance for whatever is on the system, and if virtualizing  
then probably for everything else on the virtual host, for no real benefit  
since all you’re going to do to fix it is kill the lousy process anyay.

Anyway, 2 GiB just in case you need some extra memory, but not so much  
that your box wastes tons of time in the runaway case… just let those  
things die and start fixing the heart of the problem (the process).

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below…
