Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2015 20:12:40 -0500 (EST)
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        gluster-devel@gluster.org
Cc:        freebsd-fs <freebsd-fs@freebsd.org>
Subject:   FreeBSD port of GlusterFS racks up a lot of CPU usage
Message-ID:  <571237035.145690509.1451437960464.JavaMail.zimbra@uoguelph.ca>

next in thread | raw e-mail | index | archive | help
Hi,

I'm been playing with the FreeBSD port of GlusterFS and it seems
to be working ok. I do notice that the daemons use a lot of CPU,
even when there is nothing to do (no volumes started, etc).
When I ktrace the daemon, I see a small number of nanosleep() and
select() syscalls and lots of poll() syscalls (close to 1000/sec).

Looking at libglusterfs/src/event-poll.c, I find:
   ret = poll(ufds, size, 1);
in a loop. The only thing the code seems to do when poll() times
out is a call to event_dispatch_poll_resize().

So, is it necessary to call event_dispatch_poll_resize() 1000 times
per second?
Or is there a way to make event_dispatch_poll_resize() return quickly
when there is nothing to do?

I'm guessing that Linux uses the event-epoll stuff instead of event-poll,
so it wouldn't exhibit this. Is that correct?

Thanks for any information on this, rick
ps: I am tempted to just crank the timeout of 1msec up to 10 or 20msec.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?571237035.145690509.1451437960464.JavaMail.zimbra>