The poor man’s tool for rate limiting is the sleep() procedure.
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.
|It is not recommended to use rate limiting on a route that reads logs over UDP.|