[Gluster-devel] FreeBSD port of GlusterFS racks up a lot of CPU usage

Rick Macklem rmacklem at uoguelph.ca
Wed Dec 30 01:12:40 UTC 2015


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.


More information about the Gluster-devel mailing list