[PATCH] Cache messaging dgm connections

Andrew Bartlett abartlet at samba.org
Fri Sep 16 17:31:33 UTC 2016


On Fri, 2016-09-16 at 19:25 +0200, Ralph Böhme wrote:
> On Sat, Sep 17, 2016 at 04:24:14AM +1200, Andrew Bartlett wrote:
> > 
> > On Sun, 2016-09-11 at 16:07 +0200, Ralph Böhme wrote:
> > > 
> > > Hi!
> > > 
> > > Attached is a performance improvement for our dgram messaging.
> > > 
> > > In most cases, the current code opens a new connection to peers
> > > for
> > > every message and closes it when done. This patchset adds caching
> > > of
> > > connections to peers.
> > > 
> > > Please review & push if ok.
> > 
> > I was reading over this after it got re-raised for the flapping
> > issue,
> > and I'm curious:
> > 
> > Why do you remove the direct blocking datagram send before
> > attempting
> > to create the connected socket?
> 
> we should still be attempting a direct, non-blocking sendmsg if there
> are no msgs queued for a peer:
> 
>         if (q->msgs) {
>                 /*                                                   
>                                                                      
>                                                                
>                  * To preserve message ordering, we have to queue
> a                                                                    
>                                                                   
>                  * message when others are waiting in line
> already.                                                             
>                                                                      
>     
>                  */
>                 return queue_msg(q, iov, iovlen, fds, num_fds);
>         }
> 
> 	...otherwise to a direct non-blockin sendmsg attempt...

Great.  That wasn't clear in the commit messages, so I do really
appreciate this being cleared up. 

> Cheerio!
> -slow
> 
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list