[Twisted-Python] Scalability of timers

dw+twisted-python at hmmz.org dw+twisted-python at hmmz.org
Sun Aug 10 16:47:08 MDT 2014


On Sun, Aug 10, 2014 at 03:31:11PM -0700, Tobias Oberstein wrote:

> Thanks a lot for those hints! I will read into this material.

Just a final note.. a single no-fds call to select with a 0 timeout
seems to take around 280ns on my Core 2. Presumably the better
interfaces (e.g. epoll, but not poll) will also take around the same
time.

It's really hard to write even a single Python function that gets
anywhere below 1usec CPU time, and given how function-heavy Twisted is,
I'd be surprised considerations like this factored usefully into a
design at all :)

Adjusting timer coalescing to extreme settings might even worsen your
app's performance, since it'll cause interpreter time and syscalls to
all be compressed around the slack intervals, leaving the CPU idle more
often, rather than running evenly spaced over time. This might produce
less desirable app behavior overall (e.g. it has knock-on effects for
network interface queues, bursts of disk IO/SQL queries, network switch
buffer overruns, or whatever else).


David




More information about the Twisted-Python mailing list