logstash-plugins / logstash-input-irc

Apache License 2.0
3 stars 16 forks source link

Input IRC uses 100% CPU #21

Closed makefu closed 6 years ago

makefu commented 7 years ago

For some reason the logstash irc input plugin runs at 100% cpu load even though nothing happens.

filter { }

output { stdout { codec => rubydebug } }

- Sample Data: no test data required, java runs at 100% at startup and never drops lower
- Steps to Reproduce:

bin/logstash -w 1 --log.level warn -f

untergeek commented 7 years ago

I can confirm this behavior, as it's the reason I stopped using this plugin. It's most likely the underlying ruby gem Cinch, over which we have no control. I haven't taken the time to investigate alternatives, or to troubleshoot this in any other way.

yaauie commented 6 years ago

🤔 This code looks like it could be problematic; whenever the queue is empty, we immediately try again, with no backoff:

    while !stop?
      begin
        msg = @irc_queue.pop(true)
        handle_response(msg, output_queue)
      rescue ThreadError
        # Empty queue
      end
    end

-- https://github.com/logstash-plugins/logstash-input-irc/blob/v3.0.2/lib/logstash/inputs/irc.rb#L112-L119

makefu commented 6 years ago

thanks!