Disable Linux OOM killer on GlusterFS FUSE cllient

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Here's a tip for those of you running FUSE clients on memory-constrained boxes.

Since the glusterfs client process is just a process, the OOM killer may select it for killing if the system runs out of memory for some reason.  This condition happens once in a while to me on my image thumbnailing servers-- people upload all kinds of crazy images to our site and occasionally one of them causes ImageMagick to suck up all available memory.  

If the kernel kills the glusterfs process, the FUSE mount in question becomes inaccessible and must be unmounted and remounted.  This is bad.

Anyway, I use puppet to disable the OOM killer on the glusterfs process.  Here's the exec I use for it:

  exec { 'disable-oom-killer-on-glusterfs-client':
    path    => "/bin:/sbin:/usr/bin:/usr/sbin",
    command => 'echo -17  > /proc/$(pidof /usr/sbin/glusterfs)/oom_score_adj',
    onlyif  => 'test 0 = $(cat /proc/$(pidof /usr/sbin/glusterfs)/oom_score_adj)',
    require => Package['glusterfs-client'],
  }

Another tip is to keep a sigil file in your volume, say "MOUNTED", which you can test for with your monitoring agent to see if the filesystem is accessible.  Of course, if you can't stat() the MOUNTED file, the volume is not mounted.

Hope this helps others!

--
Justin Dossey
CTO, PodOmatic

_______________________________________________
Gluster-users mailing list
Gluster-users@xxxxxxxxxxx
http://supercolony.gluster.org/mailman/listinfo/gluster-users

[Index of Archives]     [Gluster Development]     [Linux Filesytems Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux