extend/cowboy — Issue #77: Cowboy has troubles handling more than ~340000 connections
Author: oribrost
Created: 2011-10-23 16:40:49+00:00
State: open

UBUNTU Version: 11.10
Erlang version: R14B04
HEAD commit id: 66da37e30c306963a19173a1ec77a6253a9cc48d

We have a test on amazon EC2 in which we have a single server and websocket clients connecting to it at a rate of 1000 connections per sec. The clients are also running on amazon. After 340000 clients, we begin to get:

```
(sigserv001@ip-10-17-56-75.ec2.internal)101> 16:17:38.189 [error] Supervisor cowboy_acceptors_sup had child {acceptor,<0.166.0>,79} started with cowboy_acceptor:start_link(#Port<0.4369>, cowboy_tcp_transport, cowboy_http_protocol, [{dispatch,[{'_',[{[<<"ping">>],sigserv_healthcheck_handler,[]},{'_',sigserv_websocket_handler...}]}]}...], 1024, <0.164.0>, <0.165.0>) at <0.245.0> exit with reason {timeout,{gen_server,call,[<0.164.0>,{add_connection,default,<0.10127.10>}]}} in context child_terminated
16:17:56.330 [error] Supervisor cowboy_acceptors_sup had child {acceptor,<0.374.0>,93} started with cowboy_acceptor:start_link(#Port<0.4393>, cowboy_tcp_transport, sigserv_http_or_flash_protocol, [{dispatch,[{'_',[{[<<"ping">>],sigserv_healthcheck_handler,[]},{'_',sigserv_websocket_handler...}]}]}...], 1024, <0.372.0>, <0.373.0>) at <0.467.0> exit with reason {timeout,{gen_server,call,[<0.372.0>,{add_connection,default,<0.10137.10>}]}} in context child_terminated
16:17:56.396 [error] Supervisor cowboy_acceptors_sup had child {acceptor,<0.374.0>,95} started with cowboy_acceptor:start_link(#Port<0.4393>, cowboy_tcp_transport, sigserv_http_or_flash_protocol, [{dispatch,[{'_',[{[<<"ping">>],sigserv_healthcheck_handler,[]},{'_',sigserv_websocket_handler...}]}]}...], 1024, <0.372.0>, <0.373.0>) at <0.469.0> exit with reason {timeout,{gen_server,call,[<0.372.0>,{add_connection,default,<0.10138.10>}]}} in context child_terminated
16:17:56.421 [error] Supervisor cowboy_acceptors_sup had child {acceptor,<0.374.0>,20} started with cowboy_acceptor:start_link(#Port<0.4393>, cowboy_tcp_transport, sigserv_http_or_flash_protocol, [{dispatch,[{'_',[{[<<"ping">>],sigserv_healthcheck_handler,[]},{'_',sigserv_websocket_handler...}]}]}...], 1024, <0.372.0>, <0.373.0>) at <0.394.0> exit with reason {timeout,{gen_server,call,[<0.372.0>,{add_connection,default,<0.10139.10>}]}} in context child_terminated
16:17:56.504 [error] Supervisor cowboy_acceptors_sup had child {acceptor,<0.374.0>,73} started with cowboy_acceptor:start_link(#Port<0.4393>, cowboy_tcp_transport, sigserv_http_or_flash_protocol, [{dispatch,[{'_',[{[<<"ping">>],sigserv_healthcheck_handler,[]},{'_',sigserv_websocket_handler...}]}]}...], 1024, <0.372.0>, <0.373.0>) at <0.447.0> exit with reason {timeout,{gen_server,call,[<0.372.0>,{add_connection,default,<0.10140.10>}]}} in context child_terminated
16:17:56.557 [error] gen_server redis_srv terminated with reason: {timeout,{gen_server,call,[stat_srv,{global_metrics,hide}]}}
16:17:56.596 [error] CRASH REPORT Process redis_srv with 1 neighbours crashed with reason: {timeout,{gen_server,call,[stat_srv,{global_metrics,hide}]}}
```

Do you have any idea what may be causing this?