Rocket server crashing with socket error

170 views
Skip to first unread message

Fabiano Faver

unread,
Aug 1, 2017, 3:03:37 PM8/1/17
to web2py-users
environment: Debian 7.11; python 2.7.3; web2py 2.14.5 running on rocket

background:
An application that have many clients periodically sending data, some are http posts some others json. 

About 2 month ago it started to eventually throwing this error on console:

2017-08-01 15:50:37,966 - Rocket.Errors.Thread-8 - ERROR - Tried to send "400 Bad Request" to client but received socket error

But it got much more frequent and now it is like every 5 minutes and sometimes it crashes rocket server, then I need to restart it.

I have no idea what's causing this or where I can get a better traceback.

Someone have a idea what is this problem or hint i can follow?

Dave S

unread,
Aug 1, 2017, 8:41:47 PM8/1/17
to web2py-users

I have no idea.  I run Rocket on AWS without problem, but the traffic is low.   I also run Rocket on W10, and sometimes I see "waiting for socket" appear, but that only seems to affect speed, and traffic is also low (more but shorter requests than the AWS environment, but easily 1 minute or more between requests).  I suspect that "sleeping" the W10 when I go to bed causes some problems with the socket, but that wouldn't apply to you.

There may be file locks involved in Rocket, but that's just a WAG (no 'S').

/dps

Kiran Subbaraman

unread,
Aug 2, 2017, 12:13:26 AM8/2/17
to web...@googlegroups.com
About 2 months ago, did anything change in the usage of your application - more clients connecting to it, are the payloads in these connections growing in size, etc?
In that case, moving to a more performant web server would help. Nginx is recommended here. Is moving to nginx, instead of the rocket server, an option that you can consider?

As an aside: this open issue in the rocket repo makes for interesting reading: https://github.com/explorigin/Rocket/issues/1

If you intend to continue with the current setup, then you may want to try some of these:
  • Do you see any further details in the /web2py/httpserver.log
  • Edit the /web2py/logging.conf , and set the logging level to DEBUG for web2py & rocket, and see if there are more details in the resulting log file.
  • Are you able to recreate the problem using some test code on your side ... if so please share that on the forum here. I think you would need the test code to try multiple things - concurrent requests to the server, or  POST increasingly bigger payloads, etc.
________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Aug 2, 2017, 9:10:29 AM8/2/17
to web2py-users
Probably the best option is to switch to a production quality web server (e.g., Nginx + uWSGI).

Anthony

unread,
Aug 2, 2017, 9:12:32 AM8/2/17
to web2py-users
As an aside: this open issue in the rocket repo makes for interesting reading: https://github.com/explorigin/Rocket/issues/1

Note, web2py has forked Rocket and maintains its own version at https://github.com/web2py/web2py/blob/master/gluon/rocket.py.

Anthony
Reply all
Reply to author
Forward
0 new messages