{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/pinghub/issues/5","repository_url":"https://api.github.com/repos/Automattic/pinghub","labels_url":"https://api.github.com/repos/Automattic/pinghub/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/pinghub/issues/5/comments","events_url":"https://api.github.com/repos/Automattic/pinghub/issues/5/events","html_url":"https://github.com/Automattic/pinghub/pull/5","id":149002391,"number":5,"title":"Single Ticker Per Hub","user":{"login":"mermel","id":705033,"avatar_url":"https://avatars.githubusercontent.com/u/705033?v=3","gravatar_id":"","url":"https://api.github.com/users/mermel","html_url":"https://github.com/mermel","followers_url":"https://api.github.com/users/mermel/followers","following_url":"https://api.github.com/users/mermel/following{/other_user}","gists_url":"https://api.github.com/users/mermel/gists{/gist_id}","starred_url":"https://api.github.com/users/mermel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mermel/subscriptions","organizations_url":"https://api.github.com/users/mermel/orgs","repos_url":"https://api.github.com/users/mermel/repos","events_url":"https://api.github.com/users/mermel/events{/privacy}","received_events_url":"https://api.github.com/users/mermel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-17T22:22:53Z","updated_at":"2016-04-18T16:49:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/pinghub/pulls/5","html_url":"https://github.com/Automattic/pinghub/pull/5","diff_url":"https://github.com/Automattic/pinghub/pull/5.diff","patch_url":"https://github.com/Automattic/pinghub/pull/5.patch"},"body":"Change Summary:\r\n1. Remove Ticker form conn.write()\r\n2. Add test to assert connections aren't blocked/locked by inability to access ticker chan.\r\n3. Add package [multitick](https://godoc.org/github.com/VividCortex/multitick)\r\n - multitick allows time chans to 'subscribe' to a ticker on an interval\r\n - it could be something that we might want to self-implement (it's not too complicated) and we may not need the interval\r\n\r\nMemory Savings: \r\nA local benchmark with 12 concurrent connections (9 unique paths–1 path had 3 connections) for 6 ping sessions.  Benchmark yielded the below results:\r\n\r\nMultiple tickers (avg):\r\nAlloc :  631704\r\nTotal Alloc :  631704\r\nSys :  3542140\r\nLookups :  24\r\n\r\nSingle ticker (avg):\r\nAlloc :  629928\r\nTotal Alloc :  629928\r\nSys :  3542140\r\nLookups :  24\r\n\r\nNext Steps:\r\nThis is a change I would merge w/ caution, I was only able to perform a simple benchmark locally but would recommend a more comprehensive load test done in a staging environment. It would be worthwhile to see what the memory savings actually is w/ more load.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/pinghub/issues/comments/211470044","html_url":"https://github.com/Automattic/pinghub/pull/5#issuecomment-211470044","issue_url":"https://api.github.com/repos/Automattic/pinghub/issues/5","id":211470044,"user":{"login":"skeltoac","id":52292,"avatar_url":"https://avatars.githubusercontent.com/u/52292?v=3","gravatar_id":"","url":"https://api.github.com/users/skeltoac","html_url":"https://github.com/skeltoac","followers_url":"https://api.github.com/users/skeltoac/followers","following_url":"https://api.github.com/users/skeltoac/following{/other_user}","gists_url":"https://api.github.com/users/skeltoac/gists{/gist_id}","starred_url":"https://api.github.com/users/skeltoac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skeltoac/subscriptions","organizations_url":"https://api.github.com/users/skeltoac/orgs","repos_url":"https://api.github.com/users/skeltoac/repos","events_url":"https://api.github.com/users/skeltoac/events{/privacy}","received_events_url":"https://api.github.com/users/skeltoac/received_events","type":"User","site_admin":false},"created_at":"2016-04-18T16:49:36Z","updated_at":"2016-04-18T16:49:36Z","body":"Multitick is a good starting point but its subscriptions are permanent. Pinghub connections are temporary. Every resource allocated for a websocket client must be recovered when the connection goes away."}}