You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
I am trying to create an application which reads messages off of a distributed queue and processes each of them. As there are very many messages coming in (thousands per second), high throughput and performance are essential for the app.
I looked into using this daemon framework as basis for the app, but found out that despite setting the $loop_interval to 0, the maximum number of iterations per second is 100. While this may be more than enough for other, less intense workloads, it is far too little for my use case.
The code comments suggest that setting the variable to 0 would result in the loop being executed continually without delay (except for the occasional ON_IDLE event), but I found out that even when with the value 0 there is a call to usleep() which wastes a huge amount of time.
The call is in Core_daemon::timer() on line 883 (as of this writing). There the process is set to sleep for 10ms, effectively limiting the maximum number of iterations per second to 100. The comments justify doing this by needing to "give the CPU a break", but 10ms is a looooong time in CPU terms.
Please reduce the length of the break or entirely remove it, so that high-throughput, high-performance apps can also benefit from this otherwise well-written framework. I suggest 100µs as delay in between iterations.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am trying to create an application which reads messages off of a distributed queue and processes each of them. As there are very many messages coming in (thousands per second), high throughput and performance are essential for the app.
I looked into using this daemon framework as basis for the app, but found out that despite setting the $loop_interval to 0, the maximum number of iterations per second is 100. While this may be more than enough for other, less intense workloads, it is far too little for my use case.
The code comments suggest that setting the variable to 0 would result in the loop being executed continually without delay (except for the occasional ON_IDLE event), but I found out that even when with the value 0 there is a call to usleep() which wastes a huge amount of time.
The call is in Core_daemon::timer() on line 883 (as of this writing). There the process is set to sleep for 10ms, effectively limiting the maximum number of iterations per second to 100. The comments justify doing this by needing to "give the CPU a break", but 10ms is a looooong time in CPU terms.
Please reduce the length of the break or entirely remove it, so that high-throughput, high-performance apps can also benefit from this otherwise well-written framework. I suggest 100µs as delay in between iterations.
The text was updated successfully, but these errors were encountered: