减缓logstash调用http接口的速度

logstash的调用速度降下来了。 测试环境测试成功。

解决方案: 修改output的两个参数pool_max和pool_max_per_route。

根据: output plugins说明: This output lets you send events to a generic HTTP(S) endpoint.

This output will execute up to pool_max requests in parallel for performance. Consider this when tuning this plugin for performance.

两个参数说明: pool_max:Max number of concurrent connections. Defaults to 50

pool_max_per_route:Max number of concurrent connections to a single host. Defaults to 25

所以通过调整这两个参数,可以调整logstash的output的并发请求速度。

尝试过但错误的方案: 修改filter plugins的sleep参数,测试环境测试了好几次没有效果。 This will cause logstash to stall for the given amount of time. 官方文档写的是让logstash停指定时间,这里没有说明是读取input还是output的send,抑或是整个logstash的流程。

(新手入门,只是个人根据文档测试得到的solution,有问题请大佬多多指教,谢谢。)

参考文档 https://www.elastic.co/guide/en/logstash/current/plugins-outputs-http.html https://www.elastic.co/guide/en/logstash/current/plugins-filters-sleep.html

经验分享 程序员 微信小程序 职场和发展