Reputation: 173
I am setting up a play framework based server where I want to accept a huge number of concurrent websocket connections. In terms of resources, I don't see any bottleneck but my server always maxes out at 4k connections.
I am using a 2core/8gb centos 7 machine and have also bumped up the file descriptor count to 1000000.
/etc/security/limits.conf:
process_username soft nofile 1000000"
process_username hard nofile 1000000
After 4k connections, I see that it can't accept any new connections. [logger="akka.io.TcpListener"] Accept error: could not accept new connection java.io.IOException: Too many open files
Is there any configuration/setting in play's akka http server that is prohibiting large number of websocket connections?
Upvotes: 0
Views: 414
Reputation: 173
I found out. The issue was that FD values from ulimits will not be honored if the program is started as a systemd service.
In order to fix this add below attribute to the systemd unit file
[Service]
LimitNOFILE=100000 (if you want unlimited you can also use "infinity")
Upvotes: 1