25.13. Rate Limiting
The poor man’s tool for rate limiting is the sleep() procedure.
Example 112. Rate Limiting with sleep()
In the following example sleep() is invoked with 500 microseconds. This means that the input module will be able to read at most 2000 messages per second.
This is not very precise because the module can do additional processing which can add some to the total execution time, but it gets fairly close.
Warning
|
It is not recommended to use rate limiting on a route that reads logs over UDP. |