Closed yefrem closed 9 years ago
What happens?
uhm, I just described:) I have a WebSocket chat server. It works well, receives and sends messages and so on. But if nobody uses it for about two days it stops accepting clients (hangs). Browser console shows connection error and I should restart phpd to get it working again.
I was wondering what you particularly meant by 'hanging'. Try to use max-idle 15m; to have workers restarted after being idle for at least 15 minutes (for instance).
Tried max-idle but it didn't help, hung again after several days of silence. Is there any other info I should provide?
What if you pkill
workers instead of restarting whole daemon?
what should I actually check? wait until it hangs, then kill workers and see if they will be respawned?
Exactly so.
So I contacted server admin and he did what you told me. Workers restarted but server still did not respond (client could not connect) until I did "phpd restart".
Quick fix: 'user root;' and remove 'privileged;' from the pool section in config.
sadly didn't help :(
Finally I discovered that the problem was caused by errors in my authorization process which caused client disconnection. So I'm going to close this issue. Only one little question: how do I get client IP address when using WebSockets?
UPD: found it in source code. Closing issue, sorry for wasting your time.
Hi. I've set up chat server using phpDaemon and WebSockets. It's not published yet so is only used by test users. I've noticed that if I don't connect and send any messages for about 2 days it hangs, clients cannot connect and phpd restart is needed. Is there any way to fix or track it?