Question

Max number of concurrent TCP connections to droplet?

I’m running an api endpoint, and it seems like I’ve hit some droplet limit of 510 or so concurrent connections. 32gig 4 cpu ubuntu 20.04, nginx is optimized. I do have ssl passthrough with a load balancer setup, but only running one droplet under the load balancer while I figure out why the droplet is getting so few connections. I’m running an api service, which will have many thousands of concurrent connections. I have a back end api service, proxy pass to :443. I’m looking a sysctl adjustments now, but that’s my last option to see what’s up with this limit… my droplet isn’t getting hardly any load during my load tests, if I was getting out of memory errors, I’d be happy, that would mean I’m pushing the server, but I think maybe there is an undisclosed DO rate limit on tcp connections, but there isn’t any documentation I’ve found to support that hypothesis. So I’m posting here to see if anyone has/had a similar situation. I like DO, used it for years. I’m just doing more than websites, and I think I may be trying to exceed the capability of DO… any help/insight would be helpful. thanks.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

I found the issue. on top of the nginx optimizations… what fixed my low tcp connection issue was tweaking /etc/sysctl.conf

net.ipv4.ip_local_port_range = 1024 61000 net.ipv4.tcp_fin_timeout=30 net.ipv4.tcp_tw_reuse=1 net.core.somaxconn=1024 net.core.netdev_max_backlog=2000 net.ipv4.tcp_max_syn_backlog=2048

Using these resources. https://stackoverflow.com/questions/410616/increasing-the-maximum-number-of-tcp-ip-connections-in-linux https://gist.github.com/magnetikonline/2760f98f6bf654d5ad79

I have also faced the same problem. I never touched more than 500 connections on TCP on any droplet.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.