{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip/issues/395","labels_url":"https://api.github.com/repos/zulip/zulip/issues/395/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/395/comments","events_url":"https://api.github.com/repos/zulip/zulip/issues/395/events","html_url":"https://github.com/zulip/zulip/pull/395","id":123995702,"number":395,"title":"Refactor tornado to be more easily split into multiple processes","user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars.githubusercontent.com/u/2746074?v=3","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-27T20:47:10Z","updated_at":"2016-01-25T21:55:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/395","html_url":"https://github.com/zulip/zulip/pull/395","diff_url":"https://github.com/zulip/zulip/pull/395.diff","patch_url":"https://github.com/zulip/zulip/pull/395.patch"},"body":"This implements a substantial portion of the refactoring that will be required to implement #372 (running multiple Tornado processes).  The overall strategy of this is as follows:\r\n* Split the Tornado event system into two processes: a connection server (that handles auth and holds open longpolled user connections) and a queue server (that manages the queues for a particular set of users).  The idea is that each of those processes is easily shardable but the combination of them squashed together is less so.  \r\n* Remove database/memcached queries from the Tornado queue server component where possible, with the goal of having the queue server not accessing them at all, and the connection servers only access them in the auth decorators (in the future, we can change how auth works as well, but the issue is not pressing).  I believe this is basically achieved, modulo some transition code related to the Client object.  \r\n\r\nThere's some additional commits on top of this that implement splitting Tornado into two processes somewhat hackishly that you can check out to help understand where this is going:\r\nhttps://github.com/timabbott/zulip/commits/refactor-tornado-test\r\nWhile those work, I don't feel enough confidence in them to submit them for merge right now, but I think these prerequisite changes are ready for review."},"comment":{"url":"https://api.github.com/repos/zulip/zulip/issues/comments/174683809","html_url":"https://github.com/zulip/zulip/pull/395#issuecomment-174683809","issue_url":"https://api.github.com/repos/zulip/zulip/issues/395","id":174683809,"user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars.githubusercontent.com/u/2746074?v=3","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T21:55:52Z","updated_at":"2016-01-25T21:55:52Z","body":"The queue server component has somewhat complicated business logic that I'm a bit worried about trying to jam into rabbitmq or redis.  When I have a bit more time, I can write some notes on why, but I currently think that would be fairly difficult."}}