From owner-freebsd-fs@freebsd.org Wed Dec 30 01:12:48 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A4A7A561E4 for ; Wed, 30 Dec 2015 01:12:48 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC20164A for ; Wed, 30 Dec 2015 01:12:47 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:IIoJMxJPtpHtPzd+wNmcpTZWNBhigK39O0sv0rFitYgUKfTxwZ3uMQTl6Ol3ixeRBMOAu6wC07KempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lRMiK14ye7KObxd76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtM0rzyMFtPY87NJNS+D2cro1SZRXCCk9L20vosrxukrtVwyKs0EdWWZetxNDAAzI6VmuRJL4uSj+u+9VxS6VIMDyVbByUj30vPQjcwPhlCpSb21xy2rQkMEl1K8= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CoBABFLoNW/61jaINehH+IU7Zihg+BWBABAQEBAQEBAYEJgi2CDiNWEgEiAg0ZAluIRq09kQgBCwEggQGBLoQniiKCUIFJBY4wiFaLFoQtjQmOOAI5K4QoIIQ3gQgBAQE X-IronPort-AV: E=Sophos;i="5.20,498,1444708800"; d="scan'208";a="260404941" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 29 Dec 2015 20:12:40 -0500 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 0CF4215F55D; Tue, 29 Dec 2015 20:12:41 -0500 (EST) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 17xmOGaPISee; Tue, 29 Dec 2015 20:12:40 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 9771C15F565; Tue, 29 Dec 2015 20:12:40 -0500 (EST) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bofj6ks2Kuwr; Tue, 29 Dec 2015 20:12:40 -0500 (EST) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 7C28D15F55D; Tue, 29 Dec 2015 20:12:40 -0500 (EST) Date: Tue, 29 Dec 2015 20:12:40 -0500 (EST) From: Rick Macklem To: gluster-devel@gluster.org Cc: freebsd-fs Message-ID: <571237035.145690509.1451437960464.JavaMail.zimbra@uoguelph.ca> Subject: FreeBSD port of GlusterFS racks up a lot of CPU usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.12] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF43 (Win)/8.0.9_GA_6191) Thread-Topic: FreeBSD port of GlusterFS racks up a lot of CPU usage Thread-Index: aV4DNqRHLPOyieq8iWggfGqw6sDM/A== X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2015 01:12:48 -0000 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.