{"action":"created","issue":{"url":"https://api.github.com/repos/mcollina/mosca/issues/303","labels_url":"https://api.github.com/repos/mcollina/mosca/issues/303/labels{/name}","comments_url":"https://api.github.com/repos/mcollina/mosca/issues/303/comments","events_url":"https://api.github.com/repos/mcollina/mosca/issues/303/events","html_url":"https://github.com/mcollina/mosca/issues/303","id":95354359,"number":303,"title":"Why there is a maxConnections set to 100k in server.js?","user":{"login":"cfan8","id":5689300,"avatar_url":"https://avatars.githubusercontent.com/u/5689300?v=3","gravatar_id":"","url":"https://api.github.com/users/cfan8","html_url":"https://github.com/cfan8","followers_url":"https://api.github.com/users/cfan8/followers","following_url":"https://api.github.com/users/cfan8/following{/other_user}","gists_url":"https://api.github.com/users/cfan8/gists{/gist_id}","starred_url":"https://api.github.com/users/cfan8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfan8/subscriptions","organizations_url":"https://api.github.com/users/cfan8/orgs","repos_url":"https://api.github.com/users/cfan8/repos","events_url":"https://api.github.com/users/cfan8/events{/privacy}","received_events_url":"https://api.github.com/users/cfan8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-16T05:29:42Z","updated_at":"2015-07-16T12:16:21Z","closed_at":null,"body":"[Code here](https://github.com/mcollina/mosca/blob/master/lib/server.js#L199).\r\n\r\nI'm trying to build a push system using mosca.js. While I was doing some concurrency test, I found this restraint that limits the total connections that a mosca server can hold to 100k. I changed it to a larger number and see no problem when the concurrent connections reached 250k on the server side. May I ask what's the purpose of setting this number and will there be any side effect if I changed it?"},"comment":{"url":"https://api.github.com/repos/mcollina/mosca/issues/comments/121941469","html_url":"https://github.com/mcollina/mosca/issues/303#issuecomment-121941469","issue_url":"https://api.github.com/repos/mcollina/mosca/issues/303","id":121941469,"user":{"login":"behrad","id":2151889,"avatar_url":"https://avatars.githubusercontent.com/u/2151889?v=3","gravatar_id":"","url":"https://api.github.com/users/behrad","html_url":"https://github.com/behrad","followers_url":"https://api.github.com/users/behrad/followers","following_url":"https://api.github.com/users/behrad/following{/other_user}","gists_url":"https://api.github.com/users/behrad/gists{/gist_id}","starred_url":"https://api.github.com/users/behrad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behrad/subscriptions","organizations_url":"https://api.github.com/users/behrad/orgs","repos_url":"https://api.github.com/users/behrad/repos","events_url":"https://api.github.com/users/behrad/events{/privacy}","received_events_url":"https://api.github.com/users/behrad/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T12:16:21Z","updated_at":"2015-07-16T12:16:21Z","body":"> This is the one I'm using\r\n\r\nabout the same config here.\r\n\r\n\r\n> I did nothing to the V8 GC, except for increase the max-old-space-size to let V8 use more memory.\r\n\r\nforgot to say that I'm running on latest iojs, it showed performance improvements. go for it if you are still on node.js\r\n\r\n\r\n\r\n> Yeah, just wait for the 4*60K connections to establish and when CPU drops under 10%, you can start new client processes.\r\n\r\nHow are you able issuing 240K connections from a client machine? You should be setting 4 IP addresses to do that. I was unable to do the same, stuck in 60K connections with each of my clients.\r\n\r\n> Same, I'm not quite sure what's going wrong. Slowing down connection speeding and reducing the number of occupied ports on a certain IP on the client side seems to alleviate it but with no guarantee.\r\n\r\n@mcollina can comment on this. My suspect is v8's GC which will freeze mosca for seconds, that would cause many clients get keep alive timeouts, but after a sec they all get reconnected. I've no prove for this yet. You can test and see if this happens while gc turned off."}}