At the moment APR penalizes Linux[1] compared to FreeBSD by never passing SOCK_NONBLOCK in apr_socket_accept()'s accept4() calls. This is annoying for httpd, which always sets O_NONBLOCK for the accepted socket anyway - at the cost of two extra system calls.
Thanks to r1551659 [2] if you build APR *pretending* that O_NONBLOCK is inherited, it actually *will* be inherited by apr_socket_accept(), by enabling use of SOCK_NONBLOCK. ./configure ... ac_cv_o_nonblock_inherited=yes Does anybody see any reason why we couldn't build APR like this by default (...for Linux)? httpd never checks APR_O_NONBLOCK_INHERITED at build time. I did a test httpd CI run, changing the APR builds like this where possible, and it didn't make any difference. [3] An alternative would be to add an apr_socket_accept2()/_ex() which allows passing flags, which httpd could use to force use of SOCK_NONBLOCK where available. Regards, Joe [1] Strictly: on Unix platforms which don't inherit O_NONBLOCK across accept() but do have the accept4() system call [2] https://github.com/apache/apr/commit/100101fd3f1e105144fec2cd7e81b8793cca2693 [3] https://github.com/apache/httpd/pull/445 - note that not all the jobs build APR from source, rather using the Ubuntu system version