Friday, December 20, 2013

Erlang, how to change backlog in http inets server

Moving my very old posts from old engine I've found interesting problem on increasing backlog from 128 that is inappropriate for loaded system to something more suitable. Long time ago (in 2010) an only way I found to do this was to apply the following patch
> diff -u /usr/lib64/erlang/lib/inets-5.5/src/http_lib/http_transport.erl http_transport.erl 
--- /usr/lib64/erlang/lib/inets-5.5/src/http_lib/http_transport.erl     2010-09-28 12:45:42.000000000 +0300
+++ http_transport.erl  2010-12-08 17:57:42.759407719 +0200
@@ -218,7 +218,7 @@
 
 get_socket_info(Addr, Port) ->
     Key  = list_to_atom("httpd_" ++ integer_to_list(Port)),
-    BaseOpts =  [{backlog, 128}, {reuseaddr, true}], 
+    BaseOpts =  [{backlog, 10000}, {reuseaddr, true}], 
     IpFamilyDefault = ipfamily_default(Addr, Port), 
     case init:get_argument(Key) of
        {ok, [[Value]]} ->
I wonder whether this is still true.

No comments:

Post a Comment