From cdef6531caf7ec430cb0e1b4964d748be1e3dcfd Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 18 Feb 2015 14:49:14 -0500 Subject: [PATCH] Reduce cost of packet transmit eventlet only cares about multiple readers. Multiple threads doing send do not bother it. As such, just call the sendto directly rather than going through the hoop of an io_apply and the associated event creation and wait and general confusion of jumbling up the IO worker thread. This seems to buy about 10% performance gain in the ~100 server scenario doing get_health. Change-Id: Ia671f201a43f32589324b37aadf79f21548aef35 --- pyghmi/ipmi/private/session.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 50af7671..958420e0 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -1476,8 +1476,7 @@ class Session(object): _monotonic_time() return # skip transmit, let retry timer do it's thing if self.sockaddr: - _io_apply(_io_sendto, - (self.socket, self.netpacket, self.sockaddr)) + _io_sendto(self.socket, self.netpacket, self.sockaddr) else: # he have not yet picked a working sockaddr for this connection, # try all the candidates that getaddrinfo provides self.allsockaddrs = [] @@ -1493,8 +1492,7 @@ class Session(object): sockaddr = (newhost, sockaddr[1], 0, 0) self.allsockaddrs.append(sockaddr) Session.bmc_handlers[sockaddr] = self - _io_apply(_io_sendto, (self.socket, - self.netpacket, sockaddr)) + _io_sendto(self.socket, self.netpacket, sockaddr) except socket.gaierror: raise exc.IpmiException( "Unable to transmit to specified address")