{"action":"created","issue":{"url":"https://api.github.com/repos/benoitc/gunicorn/issues/1147","labels_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1147/labels{/name}","comments_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1147/comments","events_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1147/events","html_url":"https://github.com/benoitc/gunicorn/issues/1147","id":117756025,"number":1147,"title":"gunicorn 19 with WebSocket on Heroku","user":{"login":"miguelgrinberg","id":2715854,"avatar_url":"https://avatars.githubusercontent.com/u/2715854?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelgrinberg","html_url":"https://github.com/miguelgrinberg","followers_url":"https://api.github.com/users/miguelgrinberg/followers","following_url":"https://api.github.com/users/miguelgrinberg/following{/other_user}","gists_url":"https://api.github.com/users/miguelgrinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelgrinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelgrinberg/subscriptions","organizations_url":"https://api.github.com/users/miguelgrinberg/orgs","repos_url":"https://api.github.com/users/miguelgrinberg/repos","events_url":"https://api.github.com/users/miguelgrinberg/events{/privacy}","received_events_url":"https://api.github.com/users/miguelgrinberg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/benoitc/gunicorn/labels/Investigation","name":"Investigation","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-19T07:14:22Z","updated_at":"2015-11-20T10:29:44Z","closed_at":null,"body":"I'm investigating a strange problem that occurs when using gunicorn 19.0.0 or newer with an application that uses my Flask-SocketIO server, which upgrades client connections to WebSocket. \r\n\r\nThe issue, as observed from the client side, is that the connection is extremely slow. Upon inspection of the heroku logs, the slowness appears to be caused by constant timeouts and reconnects. The timeouts occur when using both the eventlet and gevent workers, each using a completely different WebSocket implementation, which I think eliminates eventlet, gevent and the server-side WebSocket code as a possible culprits. You can see detailed heroku logs on [this bug report](https://github.com/miguelgrinberg/Flask-SocketIO/issues/171).\r\n\r\nI discovered that switching to gunicorn 18 makes the problem disappear completely. With 18 the WebSocket connection is rock solid.\r\n\r\nI have also found that using any of the 19.x releases locally (without a reverse proxy in front of it) works fine, so it appears the problem is related to having the Heroku router/reverse proxy in front of gunicorn.\r\n\r\nI went through the list of changes in release 19.0.0 and can't really see anything that could be causing this. Has anyone seen this problem before? Any idea what can cause it?\r\n\r\nEdit: forgot to mention that in all local and heroku tests to troubleshoot this issue I used Python 2.7.10."},"comment":{"url":"https://api.github.com/repos/benoitc/gunicorn/issues/comments/158350860","html_url":"https://github.com/benoitc/gunicorn/issues/1147#issuecomment-158350860","issue_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1147","id":158350860,"user":{"login":"benoitc","id":14498,"avatar_url":"https://avatars.githubusercontent.com/u/14498?v=3","gravatar_id":"","url":"https://api.github.com/users/benoitc","html_url":"https://github.com/benoitc","followers_url":"https://api.github.com/users/benoitc/followers","following_url":"https://api.github.com/users/benoitc/following{/other_user}","gists_url":"https://api.github.com/users/benoitc/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitc/subscriptions","organizations_url":"https://api.github.com/users/benoitc/orgs","repos_url":"https://api.github.com/users/benoitc/repos","events_url":"https://api.github.com/users/benoitc/events{/privacy}","received_events_url":"https://api.github.com/users/benoitc/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T10:29:44Z","updated_at":"2015-11-20T10:29:44Z","body":"@tilgovi definitely . I can see 56b5f4038f60626c439e4f6be39128c63d452c53 as a possible reason for it. @miguelgrinberg can you try to revert that change and test by chance? \r\n\r\n@miguelgrinberg also which version of python are you using?"}}