{"action":"opened","issue":{"url":"https://api.github.com/repos/meteorhacks/cluster/issues/62","labels_url":"https://api.github.com/repos/meteorhacks/cluster/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/meteorhacks/cluster/issues/62/comments","events_url":"https://api.github.com/repos/meteorhacks/cluster/issues/62/events","html_url":"https://github.com/meteorhacks/cluster/issues/62","id":86621520,"number":62,"title":"Too much db connexions","user":{"login":"darkship","id":3523710,"avatar_url":"https://avatars.githubusercontent.com/u/3523710?v=3","gravatar_id":"","url":"https://api.github.com/users/darkship","html_url":"https://github.com/darkship","followers_url":"https://api.github.com/users/darkship/followers","following_url":"https://api.github.com/users/darkship/following{/other_user}","gists_url":"https://api.github.com/users/darkship/gists{/gist_id}","starred_url":"https://api.github.com/users/darkship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkship/subscriptions","organizations_url":"https://api.github.com/users/darkship/orgs","repos_url":"https://api.github.com/users/darkship/repos","events_url":"https://api.github.com/users/darkship/events{/privacy}","received_events_url":"https://api.github.com/users/darkship/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-09T14:38:42Z","updated_at":"2015-06-09T14:38:42Z","closed_at":null,"body":"I'm not sure that I have to post this issue here or on Meteor.\r\n\r\nIf I have understand, a single worker opens \r\n- a connection to each member of the replicaSet for oplog defined in MONGO_OPLOG_URL (=A)\r\n- a connection to the primary  MONGO_URL\r\n\r\nAnd the members of the replicaSet are interconnected. (=B)\r\n\r\nOn compose.io, I have a replicaSet of 1 primary,2 secondary, 1 ARBITER (B=3)and the Replica Set URI has 2 DBs (A=2).\r\n\r\n- CLUSTER_WORKERS_COUNT = x : (x+1)*(1+A)+B connections\r\n- CLUSTER_WORKERS_COUNT = 0 : (1+2)+3=6 connections\r\n- CLUSTER_WORKERS_COUNT = 1 : 2*(1+2)+3=9 connections\r\n\r\nHow comes that with 2 app instances, the first with  <code>CLUSTER_WORKERS_COUNT=3</code> and the second  <code>CLUSTER_WORKERS_COUNT=12</code>, I can have nearly 3000 connections ?\r\n\r\nI'm using forever to start/restart/stop. Could it be that using forever doesn't close or bypass the DB connections ? \r\n\r\n\r\n"}}