How to Fix Unstable Logstash Event Rate at High EPS?

I am using logrun.pl to send 1000 log events per second from a CSV file to Elastic-agent, which then forwards them to Logstash

image

When I set logrun.pl to send fewer than 100 events per second, the Event Received Rate in Logstash is relatively stable, staying around 98-99 events per second.

However, when I increase the EPS to over 100, such as 500, 1000, or 2000, the gap between the Event Received Rate in Logstash and the EPS set by logrun.pl grows larger.

I have already tried adjusting the advanced YAML settings of Elastic-agent, as well as Logstash’s memory, Pipeline Batch Size, and the number of Pipeline Workers, but these changes don’t seem to significantly stabilize the Event Received Rate.

image

What adjustments can I make to achieve a more stable Event Received Rate?