Posted in: Technical Track

Swappiness, as the name suggests, affects the swapping in the Linux systems.

Its kind of slider value. 0 means keep pages in memory as long as possible. 100 means at maximum throttle and in-between just a frequency for swapping.
The minimum value for the swappiness is 0 and the maximum is 100. The default value is 60. On the Oracle Exadata database machine it is also set to default value of 60.
Decreasing the swappiness would keep more pages in memory instead of putting them in swap space, and so those pages would occupy the memory, and in case memory is needed than on run time those pages would be swapped out, causing the overhead, but the plus side is that if those pages are accessed again, they dont have to be swapped in again, as they would already be present in the memory.
If swappiness is increased then it would swap out more aggressively, and if pages are accessed which have been swapped out, the user’s interactivity will get degradation first time.
This is all relative.
For instance, If we are observing memory shortage for the prcoess and there is lot of swapping out (so in vmstat) then we might look at increasing swappiness to swapout more to make room for more memory.
If we are observing more and more swapping in (ver frequent si in vmstat) then we could look at decreasing swappiness.
In order to play with the swappiness, you can temporarily set it by:
echo 100 > /proc/sys/vm/swappiness
and you can permanently set it in /etc/sysctl.conf

Interested in working with Fahd? Schedule a tech call.

About the Author

I am in love with Oracle blogging since 2007. The blogging coupled with extensive participation in Oracle forums, plus Oracle related speaking engagements, various Oracle certifications, teaching, and working in the trenches with Oracle technologies enabled me to get Oracle ACE award. I was the first ever Pakistani to get that award. From Oracle Open World SF to Foresight 20:20 Perth, I have been expressing my love for Exadata. These days for the last some years, I am loving the data at Pythian, and proudly writing their log buffer carnivals.

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *