Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2015 11:31:52 +0100
From:      Niels de Vos <ndevos@redhat.com>
To:        Rick Macklem <rmacklem@uoguelph.ca>
Cc:        gluster-devel@gluster.org, freebsd-fs <freebsd-fs@freebsd.org>
Subject:   Re: [Gluster-devel] FreeBSD port of GlusterFS racks up a lot of CPU usage
Message-ID:  <20151230103152.GS13942@ndevos-x240.usersys.redhat.com>
In-Reply-To: <571237035.145690509.1451437960464.JavaMail.zimbra@uoguelph.ca>
References:  <571237035.145690509.1451437960464.JavaMail.zimbra@uoguelph.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

--gqEssfNGWsEa4HfM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Dec 29, 2015 at 08:12:40PM -0500, Rick Macklem wrote:
> Hi,
>=20
> 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).
>=20
> Looking at libglusterfs/src/event-poll.c, I find:
>    ret =3D 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().
>=20
> 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 do not think this is critical. A longer timeout should be well
acceptable.

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

Well, both. most (if not all) Linux builds will use event-poll. But,
that calls epoll_wait() with a timeout of 1 millisecond as well.

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

Yes, that is probably what I would do too. And have both poll functions
use the same timeout, have it defined in libglusterfs/src/event.h. We
could make it a configurable option too, but I do not think it is very
useful to have.

Could you file a bug and/or send a patch for this?

Thanks,
Niels

--gqEssfNGWsEa4HfM
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJWg7KYAAoJECXo5AApwsWz1C8P/R4HbFzWERHQYuMm0Rhvh7O9
Fcs+CKP2emf9uwAeGtrtwwfCfskcd2J15jJkN50loCBNOYaBgz2Wjf/OzhLU2NAB
xyrQl0jEbe7e8UEvbip0NWMh5l6j8mC9ylob9DSpBwhh6o3hk3Sbf7DqXexjKsmW
evGozvFStuO2HtQBxGnQThVNRgMJFYYafjTNOMkGKahPwLNPgO9A1wWFDEE31/gJ
v7PFnnQ2Zi2GA17TPV2SoG7o0dsB7BmWlGDxoD0dPLMdhCO1jcimtF9GfZQ6H81e
D6NBvIGkDUMqjnbYIpTB9msqcGYBqtMlEEtVbwiw24WIEtgmbJI/5SeZiU7TGpOr
4dTBTMwUrvzNvUY32LaB5pDsaHYUZIQpY233qsHd/QumjhEsD9mZBhNExApOLgPZ
qHRNY8Zlsr/o4I7bPGr2weiZ0BcEj9u3GPSe76Sk0C3AcErwXUi19844L5zM6a9z
H5DsCDam68LpVLg5LUK2nK/U8k1hs2xejpvnkRLsmmYeVcp9w+gBygQx2Iwoww4w
HLOCADYdBALjC2phOKZEfeRJFnvvFANnP6tYFp+ss3WhZQB4pfH5aaO8FPwYbX2a
a+u7YXQ3EYFxRXUOCTVxQKrcV7Tshjdt5dCy9F/YNkG5tfCJAFXx+QgLH8v+VXNP
3Fq4eYm8K66KPAtg/xcw
=MKgt
-----END PGP SIGNATURE-----

--gqEssfNGWsEa4HfM--



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