[Varnish] #492: cache_waiter_epoll.c / cache_acceptor_epoll.c entire rewritten for Linux boxes better performance

Varnish varnish-bugs at projects.linpro.no
Wed Apr 22 05:21:34 CEST 2009


#492: cache_waiter_epoll.c / cache_acceptor_epoll.c entire rewritten for Linux
boxes better performance
---------------------------------------------------------------------------------+
 Reporter:  stockrt                                                              |        Owner:  phk  
     Type:  enhancement                                                          |       Status:  new  
 Priority:  high                                                                 |    Milestone:       
Component:  varnishd                                                             |      Version:  trunk
 Severity:  major                                                                |   Resolution:       
 Keywords:  cache_acceptor_epoll.c cache_waiter_epoll.c performance linux epoll  |  
---------------------------------------------------------------------------------+
Comment (by stockrt):

 Posting the description of changes again due to bad formatting:


 What should be different (and better) with this patch:

   - Sustained performance. We do not have the cost of doing a FOR_EACH
 sessions
   each time we check for timeouted sockets. This new approach is cheaper
 and
   do not impact the performance. In older versions this routine of
 checking
   all sessions could degrade the performance badly. I have seen
 degradation
   in order of reducing the capacity of handling new requests by 50% during
   that 1 or 2 seconds the older versions spent each 60s. This one do not
   suffer from that any more.

   - Respecting sess_timeout. Since the previous versions only checks for
 idle
   timeout each 60 seconds, the configured sess_timeout could not be
 respected
   in most cases. This version checks sess_timeout(ed) connections each
 100ms,
   in a smarter and cheaper way, ensuring to respect the desired idle
 timeout
   and keeping the open sockets number as low as possible.

   - Not running out of open fds limitation (SO's or Varnish's, wich came
   first) so soon.

   - Handles more than just one session event per iteration. This version
 can
   handle up to 100 session activities per event loop for each epoll_wait()
   syscall.

   - Uses Edge-Trigger (EPOLLET) for internal (pipe) session passing.

   - Uses one-shot (EPOLLONESHOT) for handling session activities.


 Regards,

 Rogério Schneider

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/492#comment:1>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list