diff --git a/NEWS b/NEWS index 3ff4831200..f6ff7bf10c 100644 --- a/NEWS +++ b/NEWS @@ -180,6 +180,10 @@ Changed Functionality processing input. Specifically in zeek -r scenarios, that is not the wanted behaviour. +- The IO loop's poll interval is now correctly reduced from 100 to 10 for + live packet sources. This should lower CPU usage for deployments with + non-selectable packet sources. + Removed Functionality --------------------- diff --git a/src/iosource/Manager.cc b/src/iosource/Manager.cc index 1cf2d9e599..6b836897b3 100644 --- a/src/iosource/Manager.cc +++ b/src/iosource/Manager.cc @@ -402,12 +402,16 @@ void Manager::Register(PktSrc* src) { pkt_src = src; + Register(src, false); + + // Once we know if the source is live or not, adapt the + // poll_interval accordingly. + // + // Note that src->IsLive() is only valid after calling Register(). if ( src->IsLive() ) poll_interval = BifConst::io_poll_interval_live; else if ( run_state::pseudo_realtime ) poll_interval = 1; - - Register(src, false); } static std::pair split_prefix(std::string path)