Question

Websocket Connection limit how to set ?

Hi there, I programmed a WebSocket server in Java, with the Javax WebSocket library My operating systems are local Windows 10, Cloud Server on Ubuntu, Web Server Apache2 + Tomcat I’m doing my tests on both sides My problem; After 256 connections, other sockets are on hold and if I open some more sockets, the web server crashes and does not respond to any requests. I’ve searched the internet a lot, I applied what I saw but could not solve the problem. I thought the problem was due to java, I tried it in nodejs (npm express-ws lib), tested it locally, but the same problem happens after the 456 is connected. Please I need help I apologize for broken language. Thanks.


Submit an answer
Answer a question...

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.

KFSys
Site Moderator
Site Moderator badge
May 7, 2021
Accepted Answer

Hi @cihad,

I might be wrong buf if you are using Apache, you might have filled up Apache’s available workers. I think the default value was exactly 256.

You can open your Apache configuration file. In there you should see something similar to:

ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000

Increase both the ServerLimit and MaxClients options, restart Apache and see if this would solve your issue.

Regards, KFSys

KFSys
Site Moderator
Site Moderator badge
May 10, 2021

Hi @cihad,

I see you were able to resolve the issue! I’m glad to see the advice helped and thank you for sharing that the solution worked!

If you ever come to face similar issue, please feel free to use the community! We’ll always be happy to try and assist you

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.