WebFaction
Community site: login faq

I am developing a simple flask app that is using Flask-Socketio. It is running on a custom websocket app and uses socket.run(app, port: < port_listen >) to run the server. Eventlet is install on the server so it should be running the server with that. The process is run by a supervisor script which is running on a different port.

The app works almost perfectly. Upon going to the webpage I can view the site, requests are successfully made, etc. My problem occurs when I attempt to refresh the page – the page times out. Typically the first refresh works, although some of the requests seem to be lost in the ether. The second refresh seems to never work on any web page regardless of its complexity.

I am worried that this has something to do with eventlet running the server. I tried to add async_mode='eventlet' in my flask app but that seems to be worse or at the least no better than before.

I have seen a few people reference celery but I am unsure if this is necessary. I am fine adding in celery if required but don't want to add complexity if it's not necessary.

Let me know if anyone wants more information, thanks in advance!

asked 25 Mar '16, 19:38

Matt Visco
25310
accept rate: 0%


It is difficult to say since it could be any number of things based on the complexity of the stack you describe.If I were you I would attempt to debug the process thread which is running the server, and see what is happening after the first request.

permanent link

answered 25 Mar '16, 22:34

johns
5.4k312
accept rate: 23%

thanks, I was able to fix it running it through gunicorn - not totally sure why eventlet couldn't do it but seems to be working well with gunicorn.

(25 Mar '16, 22:39) Matt Visco
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×44
×27
×21
×1

question asked: 25 Mar '16, 19:38

question was seen: 2,590 times

last updated: 25 Mar '16, 22:39

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM