-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello I have an issue but cannot debug due to lack of log files #349
Comments
This could be a number of things. If this error happens very rarely it is most likely the client closed the socket and you attempted to send a message to the resource after. If this starts happening a lot after a period of time it's likely you're hitting your open file limit for the application. Most system defaults are 256 or 1024 which is very low for a server. You'll need to increase that. |
Hi, thanks that makes sense, just a follow up question. If I enclose ConnectionInterface->send inside a try catch would it avoid the error (assuming the error is caused by your first statement). Also, can you enlighten me about the open file limit? I am using two servers which is load balanced so would that help, solving the problem if the error is caused by your second statement? |
I'm pretty sure I suggest just googling "open file limit" for your OS. Different OS' (even different Linux distros) have different methods of handling this, many systems even have a layered check where you'll have to adjust it in 3 places (for security reasons) to take effect. |
Hi ratchet dev, I have increase open file limits on my server, and recently I found a way to recreate this kind of error. First I opened up as many connections as I can, then I create a code that will try to send messages to my server replicating real world scenario, by the way I am using push integration. While doing this I have one terminal running top to monitor my cpu and memory utilization, and one consistently running cat /proc/sys/fs/file-nr, it seems that the websocket server code does not reach open file limit but reaches 100% cpu usage. once the cpu usage reach 100% the code will still run but refuse to accept incoming connections. Any ideas on how to maybe optimize my code? |
Hi ratchet dev, By the way, I am logging a var_dump of the event_loop object in my code. At first it was a StreamSelectLoop instance, so I tried to install libevent. Now that I've installed libevent the code somehow got more stable, but I can still recreate the error. The only difference now is that the code does not crash, instead it freezes until cpu usage get lower. |
Closed due to inactivity. |
Hi ratchet dev,
I have developed a websocket server which is running good for a couple of months, unfortunately, just recently I have encountered an error telling showing the following message:
Connection reset by peer
upon connecting to websocket. I have also encountered another error where websocket doesn't accept my connection but shows no error. Do you have any encounters like this?
The text was updated successfully, but these errors were encountered: