Re: Efficiency of caller/toss

John Goerzen
2021-08-20T19:21:07Z

On Fri, Aug 20 2021, Sergey Matveev wrote:
> Parametrizing those timeouts, sleep times of course can be done
> and
> moved to configuration file. It will be tradeoff between even
> delays
> (how fast we react on new packets appearance) and CPU time. But
> at first
> I think I should look about possibly existing to use
> epoll/inotify/kqueue
> solution for Go, that will eliminate expensive regular
> syscalling at all.
> And of course leaving current while+sleep+dir-scan algorithm as
> a fallback
> for unsupported systems (kqueue/epoll are OS-specific).

Ah, if Go has a generic library for that, that would be fantastic.
Could be used in call, caller, daemon, and toss, I would imagine.
I do think sometimes about the overhead of the periodic scans on a
server that can often have nearly 10,000 files in the spool dir.
I'm probably overthinking it, as it's almost certainly cached and
most of those are .seen files that stick around for reasons I
understand (or .hdr ones that seem to stick around mysteriously
sometimes).

John