{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/PM2/issues/1000","labels_url":"https://api.github.com/repos/Unitech/PM2/issues/1000/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/PM2/issues/1000/comments","events_url":"https://api.github.com/repos/Unitech/PM2/issues/1000/events","html_url":"https://github.com/Unitech/PM2/issues/1000","id":56946449,"number":1000,"title":"Node 0.12 - PM2@latest and cluster_mode passing to all processes","user":{"login":"askhogan","id":635449,"avatar_url":"https://avatars.githubusercontent.com/u/635449?v=3","gravatar_id":"","url":"https://api.github.com/users/askhogan","html_url":"https://github.com/askhogan","followers_url":"https://api.github.com/users/askhogan/followers","following_url":"https://api.github.com/users/askhogan/following{/other_user}","gists_url":"https://api.github.com/users/askhogan/gists{/gist_id}","starred_url":"https://api.github.com/users/askhogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/askhogan/subscriptions","organizations_url":"https://api.github.com/users/askhogan/orgs","repos_url":"https://api.github.com/users/askhogan/repos","events_url":"https://api.github.com/users/askhogan/events{/privacy}","received_events_url":"https://api.github.com/users/askhogan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Unitech/PM2/labels/need%20investigation","name":"need investigation","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-08T10:12:15Z","updated_at":"2015-02-15T01:58:05Z","closed_at":null,"body":"I setup a simple express script.  I then set it up similar to the existing examples and existing test cases\r\n\r\nI setup a simple route that does nothing but log.  I performed an http GET to this route and I received log writing on all 8 processes.  Per the documentation it seemed that PM2 handles routing to only one cluster process at a time.  I am not seeing that happen.  All processes get the same GET request and perform the same call 8x times.  \r\n\r\nHow do you setup a config to only process 1 time per API request?\r\n\r\nAPI-7 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\nAPI-6 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\nAPI-5 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\nAPI-4 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\nAPI-3 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\nAPI-2 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\nAPI-1 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\nAPI-0 (out): 2015-02-08 10:10 +00:00: [2015-02-08 10:10:28.585] [WARN] api - healthy\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Unitech/PM2/issues/comments/74400543","html_url":"https://github.com/Unitech/PM2/issues/1000#issuecomment-74400543","issue_url":"https://api.github.com/repos/Unitech/PM2/issues/1000","id":74400543,"user":{"login":"bwin","id":1673361,"avatar_url":"https://avatars.githubusercontent.com/u/1673361?v=3","gravatar_id":"","url":"https://api.github.com/users/bwin","html_url":"https://github.com/bwin","followers_url":"https://api.github.com/users/bwin/followers","following_url":"https://api.github.com/users/bwin/following{/other_user}","gists_url":"https://api.github.com/users/bwin/gists{/gist_id}","starred_url":"https://api.github.com/users/bwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwin/subscriptions","organizations_url":"https://api.github.com/users/bwin/orgs","repos_url":"https://api.github.com/users/bwin/repos","events_url":"https://api.github.com/users/bwin/events{/privacy}","received_events_url":"https://api.github.com/users/bwin/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T01:58:04Z","updated_at":"2015-02-15T01:58:04Z","body":"@askhogan it does work exactly as you expected. You can verify that with the following:\r\n```javascript\r\n// app.js\r\nvar http = require('http');\r\nhttp.createServer(function(req, res) {\r\n\tconsole.log(\"req\", req.method, req.url);\r\n\tres.writeHead(200);\r\n\tres.end('hey '+ (new Date()));\r\n}).listen(8000);\r\n```\r\n\r\nThen start it with `pm2 start --name testapp -i 4 app.js`. Watch the logs with `pm2 logs` and make a request to localhost:8000. You will see that only one worker responds (everything else wouldn't make sense).\r\nAs soyuka pointed out this is done with the cluster module from node-core. Only node > 0.10 is suppored though.\r\nHave you checked your node version? If you're using a supported node version, you should investigate why your app won't work with the cluster module, since an express app out of the box should work AFAIK."}}