{"action":"created","issue":{"url":"https://api.github.com/repos/unbit/uwsgi/issues/926","labels_url":"https://api.github.com/repos/unbit/uwsgi/issues/926/labels{/name}","comments_url":"https://api.github.com/repos/unbit/uwsgi/issues/926/comments","events_url":"https://api.github.com/repos/unbit/uwsgi/issues/926/events","html_url":"https://github.com/unbit/uwsgi/issues/926","id":77738618,"number":926,"title":"uwsgi + gevent several workers strange behavior","user":{"login":"vandreevich","id":2163544,"avatar_url":"https://avatars.githubusercontent.com/u/2163544?v=3","gravatar_id":"","url":"https://api.github.com/users/vandreevich","html_url":"https://github.com/vandreevich","followers_url":"https://api.github.com/users/vandreevich/followers","following_url":"https://api.github.com/users/vandreevich/following{/other_user}","gists_url":"https://api.github.com/users/vandreevich/gists{/gist_id}","starred_url":"https://api.github.com/users/vandreevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vandreevich/subscriptions","organizations_url":"https://api.github.com/users/vandreevich/orgs","repos_url":"https://api.github.com/users/vandreevich/repos","events_url":"https://api.github.com/users/vandreevich/events{/privacy}","received_events_url":"https://api.github.com/users/vandreevich/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-18T17:34:43Z","updated_at":"2015-05-19T09:10:33Z","closed_at":"2015-05-19T09:10:33Z","body":"I've discovered a strange behavior while running uwsgi and gevent as loop engine. If workers=1 everything is fine. However if workers=8(actually greater than 2) application stucks sometimes when we try to do just one request. And if we start several simultaneous requests (using siege -c 20 for example) everything seems to work fine again.  \r\n\r\nHere is my simple application:\r\n``` python\r\nimport gevent\r\nimport gevent.socket\r\nimport gevent.queue\r\n\r\nqueue = gevent.queue.Queue()\r\n\r\nhost = 'google.com'\r\nport = 80\r\n\r\ndef application(env, start_response):\r\n    \r\n    print gevent.socket.getaddrinfo(host, port, gevent.socket.AF_INET, gevent.socket.SOCK_STREAM, 0)\r\n\r\n    start_response('200 OK', [('Content-Type','text/html')])\r\n    return [b\"Hello World\"]\r\n```\r\n\r\nAnd the settings:\r\n```ini\r\n[uwsgi]\r\nvenv =/path/to/venv/\r\nmaster=True\r\npidfile=/path/to/app.pid\r\nworkers=8\r\ngevent=20\r\nhttp = 127.0.0.1:2121                                       \r\n```\r\n\r\npackages:\r\n* gevent==1.0.1\r\n* uWSGI==2.0.10\r\n\r\n OS is FreeBSD 10.1-STABLE. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/unbit/uwsgi/issues/comments/103409024","html_url":"https://github.com/unbit/uwsgi/issues/926#issuecomment-103409024","issue_url":"https://api.github.com/repos/unbit/uwsgi/issues/926","id":103409024,"user":{"login":"vandreevich","id":2163544,"avatar_url":"https://avatars.githubusercontent.com/u/2163544?v=3","gravatar_id":"","url":"https://api.github.com/users/vandreevich","html_url":"https://github.com/vandreevich","followers_url":"https://api.github.com/users/vandreevich/followers","following_url":"https://api.github.com/users/vandreevich/following{/other_user}","gists_url":"https://api.github.com/users/vandreevich/gists{/gist_id}","starred_url":"https://api.github.com/users/vandreevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vandreevich/subscriptions","organizations_url":"https://api.github.com/users/vandreevich/orgs","repos_url":"https://api.github.com/users/vandreevich/repos","events_url":"https://api.github.com/users/vandreevich/events{/privacy}","received_events_url":"https://api.github.com/users/vandreevich/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T09:10:33Z","updated_at":"2015-05-19T09:10:33Z","body":"fixed by\r\nos.environ['GEVENT_RESOLVER'] = 'ares'"}}