From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8860B1F45A; Sun, 11 Aug 2019 16:51:36 +0000 (UTC) Date: Sun, 11 Aug 2019 16:51:36 +0000 From: Eric Wong To: Jan Kiszka Cc: meta@public-inbox.org Subject: Re: High polling frequency of public-inbox-watch Message-ID: <20190811165136.py6bfldsg6tz4wak@dcvr> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: Jan Kiszka wrote: > Hi, > > I'm running public-inbox for some months very successfully on my server. Great work! Good to know :> > On thing though: I realized that the public-inbox-watch service is scanning the > configured maildirs with a sleep delay of just 2 seconds, and that causes a CPU > load of 20-30% on my box. Can this be configured to a more moderate rate? I > would have patched this already, but I'm not seeing in the code where these 2 > seconds may come from. I guess it's from Filesys::Notify::Simple. Which OS are you using? It should be able to use inotify / kqueue depending on whether you're on Linux or FreeBSD (I haven't tested other BSDs). It uses Linux::Inotify2 on Linux which AFAIK all deb-based distros will pull in, and Filesys::Notify::KQueue on KQueue-supported systems.