- zone_reclaim_mode defaults to the wrong value for database servers, 1, on some Linux distributions, including Red Hat.
- This default will both cause Linux to fail to use all available RAM for caching, and throttle writes.
- If you're running PostgreSQL, make sure that zone_reclaim_mode is set to 0.
Saturday, August 25, 2012
Wrong defaults for zone_reclaim_mode on Linux
My coworker Jeff Frost just published a writeup on "zone reclaim mode" in Linux, and how it can be a problem. Since his post is rather detailed, I wanted to give a "do this" summary:
Labels:
linux,
memory,
performance,
postgresql
Subscribe to:
Post Comments (Atom)
This comment has been removed by the author.
ReplyDeleteDefaults to zero on my system.
Delete$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
$ uname -a
Linux work-desktop 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/sysctl.conf | grep zone
$ cat /proc/sys/vm/zone_reclaim_mode
0
After a little more looking, Both of us are correct. It can be different depending on the machine. HOpefully you can check view:
Deletehttps://access.redhat.com/site/solutions/60669
To paraphrase:
The commit 9eeff2395e3cfd05c9b2e6074ff943a34b0c5c21 introduced this.
For more details, please check the upstream kernel discussion here : http://marc.info/?l=linux-kernel&m=113408418232531&w=2
In RHEL-6.1 'zone_reclaim_mode' is set to 1 and in RHEL-6.2 it set back to 0.