> -----Ursprüngliche Nachricht----- > Von: Yann Ylavic [mailto:[email protected]] > Gesendet: Donnerstag, 18. August 2016 15:17 > An: httpd-dev <[email protected]> > Betreff: Re: Frequent wake-ups for mpm_event > > On Thu, Aug 18, 2016 at 11:04 AM, Plüm, Rüdiger, Vodafone Group > <[email protected]> wrote: > > > > From: Luca Toscano [mailto:[email protected]] > > Sent: Freitag, 12. August 2016 15:42 > > To: Apache HTTP Server Development List > > Subject: Re: Frequent wake-ups for mpm_event > > > >> This patch might also miss another point, namely the calls to > >> process_timeout_queue to manage Keep Alive timeouts, lingering closes > and > >> write completion. IIUC mpm-event explicitly process them after each > wake up > >> (every 100ms). > >> > >> Will work more on it, in the meantime thanks to all for the feedback! > > > > Does it make sense to get the shortest timeout from keepalive_q, > > write_completion_q, linger_q and short_linger_q and set this value > instead > > of -1? > > I was thinking of something like the attached patch, where we compute > the exact/minimal timeout needed for the queues. > > It requires walking/locking the queues (looking at the first item > only), but besides getting the exact poll() timeout which helps > spurious wakeups, it also allows to avoid walking this queues after > the poll() (previously each 0.1s, for maintenance) when not necessary. > So overall I think it's a gain. > > The patch is only compile-tested and may not work as is, I just wanted > to show the principle for feedbacks. WDYT? >
From a brief view looks good, but you miss to adjust ps->keep_alive in case that keepalives are killed due to busy workers. And I don't get why we need this additional num = 0. Regards Rüdiger
