SO_REUSEPORT: strange kernel balancer behaviour

2013-07-12 Thread trafdev
Hello. Could someone help with following problem of SO_REUSEPORT. Created server: int sockd_acceptor_; ... if ((sockd_acceptor_ = socket(PF_INET, SOCK_STREAM, 0)) == -1) { LOG4CXX_ERROR_ERRNO(kLogger, "socket"); return false; } struct sockaddr_in sa_in; memset(&sa_i

Re: SO_REUSEPORT: strange kernel balancer behaviour

2013-07-15 Thread trafdev
Thanks for reply. This approach produces lot of "resource temporary unavailable" (eagain) on accept-ing connections in N-1 processes. Is this possible to avoid this by e.g. tweaking kqueue? On Sun Jul 14 19:37:59 2013, Sepherosa Ziehau wrote: On Sat, Jul 13, 2013 at 1:16 PM, traf

Re: SO_REUSEPORT: strange kernel balancer behaviour

2013-07-15 Thread trafdev
stening on the same port. All threads wake up on each accepted connection, one thread wins and the other threads get EAGAIN. -adrian On 15 July 2013 12:31, trafdev wrote: Thanks for reply. This approach produces lot of "resource temporary unavailable" (eagain) on accept-ing connecti

Re: SO_REUSEPORT: strange kernel balancer behaviour

2013-07-22 Thread trafdev
g the fewest connections;" I'm getting almost same results On Mon Jul 22 13:02:05 2013, John-Mark Gurney wrote: trafdev wrote this message on Mon, Jul 15, 2013 at 13:04 -0700: Yep I think it's wasting of resources, poll manager should somehow be configured to update only one process

Re: SO_REUSEPORT: strange kernel balancer behaviour

2013-07-22 Thread trafdev
yep, FreeBSD 9.1-RELEASE-p3 On Mon Jul 22 21:05:55 2013, Adrian Chadd wrote: On 22 July 2013 14:26, trafdev wrote: Actually overhead is almost zero, the real problem is in non-equivalent load distribution between processes. As https://lwn.net/Articles/542629/ mentions - "At Google, they

Re: SO_REUSEPORT: strange kernel balancer behaviour

2013-07-23 Thread trafdev
It's like shared acceptor FD and N processes: Listening proc: bool HttpServer::Listen(unsigned short port, uint listen_backlog) { LOG4CXX_TRACE(kLogger, "Listen"); if ((sockd_acceptor_ = socket(AF_INET, SOCK_STREAM, 0)) == -1) { LOG4CXX_ERROR_ERRNO(kLogger, "socket"); return

Re: SO_REUSEPORT: strange kernel balancer behaviour

2013-07-23 Thread trafdev
port 1667, with SO_REUSEPORT * only the first thread ever sees incoming requests. I think this load distribution feature is useful to implement, but it shouldn't be called SO_REUSEPORT. (Silly Linux, why would you do that too..) -adrian On 23 July 2013 07:39, Adrian Chadd wrote: On 23 July