{"id":24823030,"url":"https://github.com/arjun-r34/node_cluster","last_synced_at":"2025-10-18T05:37:35.912Z","repository":{"id":128023505,"uuid":"559831988","full_name":"ARJUN-R34/node_cluster","owner":"ARJUN-R34","description":"A PoC demonstrating scaling of NodeJS applications using cluster","archived":false,"fork":false,"pushed_at":"2022-10-31T08:04:24.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T22:24:01.409Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ARJUN-R34.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-31T07:28:05.000Z","updated_at":"2022-10-31T08:07:18.000Z","dependencies_parsed_at":"2023-05-29T04:45:35.725Z","dependency_job_id":null,"html_url":"https://github.com/ARJUN-R34/node_cluster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ARJUN-R34/node_cluster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARJUN-R34%2Fnode_cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARJUN-R34%2Fnode_cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARJUN-R34%2Fnode_cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARJUN-R34%2Fnode_cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ARJUN-R34","download_url":"https://codeload.github.com/ARJUN-R34/node_cluster/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARJUN-R34%2Fnode_cluster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270837583,"owners_count":24654391,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-01-30T19:46:38.875Z","updated_at":"2025-10-18T05:37:30.867Z","avatar_url":"https://github.com/ARJUN-R34.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Cluster\n\n#### This is a PoC demonstrating the scaling of nodejs applications using clusters. The master process will spawn `n` child processes to distribute the load among the child processes to scale the single threaded nodejs applications.\n\n#### This application simply generates a random number and returns it as the API response in 10 seconds. The 10s delay is added to simulate the complexity of certain nodejs APIs and also to perform multiple concurrent requests.\n\n\u003cbr\u003e\n\n### How to use\n\n\u003cbr\u003e\n\n\u003e Clone the repository\n\n```sh\ngit clone https://github.com/ARJUN-R34/node_cluster.git\n\ncd node_cluster\n```\n\n\u003cbr\u003e\n\n\u003e Install dependencies\n\n```sh\nnpm ci\n```\n\n\u003cbr\u003e\n\n\u003e Run the application\n\nUpdate the `.env` file with your desired port to run the application and the number of child processes you want to spawn.\n\n```sh\nnpm run start\n```\n\nYou can see the process Ids of all the child processes in the logs.\n\n\u003cbr\u003e\n\n\u003e To load test the application\n\nInstall the loadtest cli globally in your system\n\n```sh\nnpm install -g loadtest\n```\n\nIn your application, run the loadtest using,\n\n```sh\nloadtest http://localhost:{PORT}/test -n 100 -c 80\n```\n\n`100` is the total number of requests to be made and `80` is the number of concurrent requests to be performed. You can change it the way you like.\n\nYou can see the process Ids each API call is assigned to in the logs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun-r34%2Fnode_cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjun-r34%2Fnode_cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun-r34%2Fnode_cluster/lists"}