[PATCH] Cache messaging dgm connections

Ralph Böhme slow at samba.org
Fri Sep 16 17:25:25 UTC 2016


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...

Cheerio!
-slow



More information about the samba-technical mailing list