Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logstash cpu usage fix #2607

Merged
merged 5 commits into from
Oct 12, 2020
Merged

Conversation

adityacs
Copy link
Collaborator

@adityacs adityacs commented Sep 9, 2020

What this PR does / why we need it:
Fixes unnecessary cpu usage by logstash. This is happening because loop select is expected to block on multiple channels and not just run the loop indefinitely. Looks like concurrent-ruby library is not handling this. Also, tried agent but even this library is not handling channel block and receive as expected. So, changed the implementation to handle concurrency using just Ruby Threads.

Which issue(s) this PR fixes:
Fixes #2551

After the initial startup, CPU usage is minimal

Screenshot 2020-09-09 at 5 08 13 PM

@stale
Copy link

stale bot commented Oct 9, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Oct 9, 2020
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shame on me I didn't review this before.

LGTM Thank you @adityacs

@stale stale bot removed the stale A stale issue or PR that will automatically be closed. label Oct 12, 2020
@cyriltovena cyriltovena merged commit 772b7ff into grafana:master Oct 12, 2020
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Oct 21, 2020
* Replace concurrent-ruby-edge with agent lib

* Fix logstash cpu consumption

* increment gemspec version

* increment gemspec version

* fix tests

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@kzzalews
Copy link

kzzalews commented Nov 12, 2020

Is there an estimation when new version of logstash-output-loki that contains this fix will be released? See: https://rubygems.org/gems/logstash-output-loki

@cyriltovena
Copy link
Contributor

I just did sorry for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logstash with logstash-output-loki plugin make Logstash use too much CPU
3 participants