{"id":18656582,"url":"https://github.com/zendesk/ipcluster","last_synced_at":"2025-09-11T16:40:02.301Z","repository":{"id":44539565,"uuid":"26890597","full_name":"zendesk/ipcluster","owner":"zendesk","description":"Node.js master/worker clustering module for sticky session load balancing using IPTABLES","archived":false,"fork":false,"pushed_at":"2024-12-09T04:05:02.000Z","size":96,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":326,"default_branch":"master","last_synced_at":"2025-03-25T16:51:35.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zendesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-20T01:45:50.000Z","updated_at":"2024-12-09T02:55:23.000Z","dependencies_parsed_at":"2024-12-09T03:31:59.408Z","dependency_job_id":"9650e585-2e07-433f-977b-21ea9316be3c","html_url":"https://github.com/zendesk/ipcluster","commit_stats":null,"previous_names":["zopim/ipcluster"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fipcluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fipcluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fipcluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fipcluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zendesk","download_url":"https://codeload.github.com/zendesk/ipcluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248458373,"owners_count":21107064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:24:07.706Z","updated_at":"2025-04-11T18:30:57.045Z","avatar_url":"https://github.com/zendesk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"IPCluster\n=========\n\n![repo-checks](https://github.com/zendesk/ipcluster/workflows/repo-checks/badge.svg)\n\nIPCluster is a \"bare-metal\" library for Node.js to manage multi-core concurrency, with sticky sessions and zero-downtime reloading.\n\nFeatures\n--------\n* Sticky sessions (via iptables abuse) - suitable for long-polling\n* Configurable per-process and cluster memory limits\n* Graceful shutdowns and restarts\n* Renice older workers\n\nDependencies\n------------\n* npm modules - toobusy-js, q\n\n_IPCluster sticky sessions currently requires `iptables` for sticky sessions and so is Linux-only_\n\nSetup\n=====\n\nnpm dependencies\n----------------\n    npm install\n\niptables sudo support\n---------------------\nsudo iptables support is required in order to support sticky sessions.\n\nAdd to sudoers (visudo):\n\n    \u003cnode\u003e ALL=(ALL) NOPASSWD: /sbin/iptables -t nat -L\n    \u003cnode\u003e ALL=(ALL) NOPASSWD: /sbin/iptables -t nat -[ID] PREROUTING -p tcp -m tcp -s 0.0.0.*/0.0.0.* -d * --dport 80 -j REDIRECT --to-ports ?????\n    \u003cnode\u003e ALL=(ALL) NOPASSWD: /sbin/iptables -t nat -[ID] PREROUTING -p tcp -m tcp -s 0.0.0.*/0.0.0.* -d * --dport 443 -j REDIRECT --to-ports ?????\netc. for other ports\n\nChange `\u003cnode\u003e` to the running user.\n\nThankfully, iptables does not allow duplicate copies of most flags, so that the `*` wildcards can't be abused (much). Nonetheless, security feedback is welcome. An alternative for `*` would be appreciated.\n\nUsage\n=====\n    npm install ipcluster --save\n\nSee https://github.com/zendesk/zopim-ipcluster-example for a simple example.\n\nIn your application\n-------------------\n\n### Deploying new code / Running a new batch of workers\n\nOnce you app is ipcluster-enabled, starting it should start a master that will spawn multiple workers. The workers are _not_ child processes (they will outlive the master).\n\nTo start a new batch a workers (e.g. when you are deployig new code), you should kill off the old master, and start a new master. The old workers will still be running happily.\n\nStarting a new master will do 2 things:\n  - Spawn a new generation of workers, running your latest code for all new incoming connections\n  - Become the master for all old workers, and manage their retirement and (eventual) destruction\n\nNote: you can start a new master without first killing the old one. The new master will find and terminate the old master as part of its boot up sequence.\n\nSignals\n-------\nThe master process understands these signals:\n  - `SIGUSR1`: Kills all retired workers.\n\nContributing\n============\n\nLinting\n-------------------\n\nRun eslint\n\n    npm run lint\n\nTesting\n-------\nipcluster contains some unit tests made with [nodeunit](https://github.com/caolan/nodeunit) (with many more to come, thanks to **you**!). At the root of the project run:\n\n    npm test\n\nDo run the test suite prior to committing.\n\nCopyright and license\n=====================\nCopyright 2014 Zopim\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Fipcluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzendesk%2Fipcluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Fipcluster/lists"}