How many max kernel timers can run concurrently?

Greg KH greg at kroah.com
Tue Oct 3 08:07:08 EDT 2017


On Tue, Oct 03, 2017 at 05:13:09PM +0530, Swapnil N wrote:
> Hi All,
> 
> I am trying to implement a timer based stats notification for running
> UDP streams. Mostly a timer per UDP session will send UDP statistics
> to userspace via netlink.
> 
> I would like to know,
> 1. How many max number of kernel timers I can run simultaneously? I've
> max 40K UDP sessions.

Try it and see!

> 2. Will there be any performance impact when max number of timers are ticking?

Timers do not "tick", they either expire or are cancelled[1].  So the
impact is when other timers expire or are cancelled in the system, as
the internal data structures will have grown really large with all of
your new timers.

Are you sure a timer is what you want to use here?

good luck!

greg k-h

[1] Turns out something like 99% of all timers end up being cancelled
    and never expiring in a normal running kernel, which is the opposite
    of what the original data structures were designed for.



More information about the Kernelnewbies mailing list