{"action":"closed","issue":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/2632","repository_url":"https://api.github.com/repos/medic/medic-webapp","labels_url":"https://api.github.com/repos/medic/medic-webapp/issues/2632/labels{/name}","comments_url":"https://api.github.com/repos/medic/medic-webapp/issues/2632/comments","events_url":"https://api.github.com/repos/medic/medic-webapp/issues/2632/events","html_url":"https://github.com/medic/medic-webapp/issues/2632","id":170954680,"number":2632,"title":"Legacy v0.4.x instances: remove socket limit in medic-api","user":{"login":"browndav","id":763977,"avatar_url":"https://avatars.githubusercontent.com/u/763977?v=3","gravatar_id":"","url":"https://api.github.com/users/browndav","html_url":"https://github.com/browndav","followers_url":"https://api.github.com/users/browndav/followers","following_url":"https://api.github.com/users/browndav/following{/other_user}","gists_url":"https://api.github.com/users/browndav/gists{/gist_id}","starred_url":"https://api.github.com/users/browndav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browndav/subscriptions","organizations_url":"https://api.github.com/users/browndav/orgs","repos_url":"https://api.github.com/users/browndav/repos","events_url":"https://api.github.com/users/browndav/events{/privacy}","received_events_url":"https://api.github.com/users/browndav/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/medic/medic-webapp/labels/4%20-%20Acceptance%20Testing","name":"4 - Acceptance Testing","color":"fef2c0"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Technical%20Debt","name":"Technical Debt","color":"7a5887"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/v0.4%20upgrading","name":"v0.4 upgrading","color":"fef2c0"}],"state":"closed","locked":false,"assignee":{"login":"browndav","id":763977,"avatar_url":"https://avatars.githubusercontent.com/u/763977?v=3","gravatar_id":"","url":"https://api.github.com/users/browndav","html_url":"https://github.com/browndav","followers_url":"https://api.github.com/users/browndav/followers","following_url":"https://api.github.com/users/browndav/following{/other_user}","gists_url":"https://api.github.com/users/browndav/gists{/gist_id}","starred_url":"https://api.github.com/users/browndav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browndav/subscriptions","organizations_url":"https://api.github.com/users/browndav/orgs","repos_url":"https://api.github.com/users/browndav/repos","events_url":"https://api.github.com/users/browndav/events{/privacy}","received_events_url":"https://api.github.com/users/browndav/received_events","type":"User","site_admin":false},"assignees":[{"login":"browndav","id":763977,"avatar_url":"https://avatars.githubusercontent.com/u/763977?v=3","gravatar_id":"","url":"https://api.github.com/users/browndav","html_url":"https://github.com/browndav","followers_url":"https://api.github.com/users/browndav/followers","following_url":"https://api.github.com/users/browndav/following{/other_user}","gists_url":"https://api.github.com/users/browndav/gists{/gist_id}","starred_url":"https://api.github.com/users/browndav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browndav/subscriptions","organizations_url":"https://api.github.com/users/browndav/orgs","repos_url":"https://api.github.com/users/browndav/repos","events_url":"https://api.github.com/users/browndav/events{/privacy}","received_events_url":"https://api.github.com/users/browndav/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/medic/medic-webapp/milestones/62","html_url":"https://github.com/medic/medic-webapp/milestones/October%203rd%20-%20October%2017th","labels_url":"https://api.github.com/repos/medic/medic-webapp/milestones/62/labels","id":2036089,"number":62,"title":"October 3rd - October 17th","description":"","creator":{"login":"garethbowen","id":2064938,"avatar_url":"https://avatars.githubusercontent.com/u/2064938?v=3","gravatar_id":"","url":"https://api.github.com/users/garethbowen","html_url":"https://github.com/garethbowen","followers_url":"https://api.github.com/users/garethbowen/followers","following_url":"https://api.github.com/users/garethbowen/following{/other_user}","gists_url":"https://api.github.com/users/garethbowen/gists{/gist_id}","starred_url":"https://api.github.com/users/garethbowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethbowen/subscriptions","organizations_url":"https://api.github.com/users/garethbowen/orgs","repos_url":"https://api.github.com/users/garethbowen/repos","events_url":"https://api.github.com/users/garethbowen/events{/privacy}","received_events_url":"https://api.github.com/users/garethbowen/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":15,"state":"open","created_at":"2016-09-28T21:35:39Z","updated_at":"2016-10-10T22:04:11Z","due_on":"2016-10-17T00:00:00Z","closed_at":null},"comments":6,"created_at":"2016-08-12T20:38:41Z","updated_at":"2016-10-10T22:04:11Z","closed_at":"2016-10-10T22:04:11Z","body":"In https://github.com/medic/medic-api/blob/0.4.x/server.js#L31, we limit the maximum number of Express.js server sockets to 100. This proved unnecessarily low in the 2.8.x/master branch and was removed entirely, effectively making the limit infinite, which worked out okay. We never did the same for the older v0.4.x instances.\r\n\r\nSymptom: nginx is timing out while attempting to connect to the local `medic-api` on port 5988. This repeats regularly for a while and then dies down:\r\n\r\n```\r\n2016/08/12 18:22:03 [error] 30226#0: *404098 upstream timed out\r\n  (110: Connection timed out) while reading response header from upstream,\r\n  client: 127.0.0.1, server: _, request: \"GET /medic/_design/medic/_rewrite/add HTTP/1.1\",\r\n  upstream: \"http://127.0.0.1:5988/medic/_design/medic/_rewrite/add\", host: \"localhost\"\r\n```\r\n\r\nTheory: under heavy load, the pool of 100 sockets is exhausted and requests start getting dropped on the floor with no response.\r\n\r\nPush an update to v0.4.x that removes `http.globalAgent.maxSockets = 100;` from the bundled Medic API, and does nothing else."}}
{"actor":{"display_login":"garethbowen"}}