{"id":19390288,"url":"https://github.com/jaimerc/node-vs-golang","last_synced_at":"2026-05-04T15:39:34.118Z","repository":{"id":135546007,"uuid":"299698443","full_name":"JaimeRC/node-vs-golang","owner":"JaimeRC","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-12T20:58:55.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T09:37:57.522Z","etag":null,"topics":["benchmark","docker","docker-compose","golang","nodejs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaimeRC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-09-29T18:03:53.000Z","updated_at":"2020-10-25T12:04:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"2870ed49-eb84-4abf-981a-26cb8e708e31","html_url":"https://github.com/JaimeRC/node-vs-golang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaimeRC%2Fnode-vs-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaimeRC%2Fnode-vs-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaimeRC%2Fnode-vs-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaimeRC%2Fnode-vs-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaimeRC","download_url":"https://codeload.github.com/JaimeRC/node-vs-golang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240549430,"owners_count":19819137,"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":["benchmark","docker","docker-compose","golang","nodejs"],"created_at":"2024-11-10T10:19:58.934Z","updated_at":"2026-05-04T15:39:34.088Z","avatar_url":"https://github.com/JaimeRC.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-vs-golang\n\nIn this project what is tried is to compare the effectiveness of a Node and Golagitng server with an overload test.\n\n## Folder structure\n    docker-compose.yml                 # Containers\n        ├─── docs                      # Documentation\n        ├─── api-golang                # API Rest with Golang\n        ├─── api-node                  # API Rest with NodeJS\n        └─── bench.sh                  # Script for launch test\n\n## Requirements\n- [Docker](https://docs.docker.com/get-docker/) y [Docker-Compose](https://docs.docker.com/compose/install/)\n- [Bash 5.0](https://medium.com/@thechiefalone/how-to-install-bash-5-0-mac-os-ae570be6c687)\n- [gnuplot](http://www.gnuplot.info/)\n\n## Tests\n\nThe tests configured in the code are:\n\n| Test      | Requests | Concurrents |\n| :-------: | :------: | :-----:     |\n| 0         | 100      | 1           |\n| 1         | 1000     | 100         |\n| 2         | 10000    | 1000        |  \n\nTo modify or add more tests, you must go to the file `bench.sh` \nand in the first lines they show the structure of the tests:\n\n        # TEST 0\n        declare -A test0=(\n            [requests]=100\n            [concurrent]=1\n            [name]='test0'\n        )\n\nThe field `name` is important because save de data under the name.\n\n## Init\n\n1. Clone the repository:\n    \n        git clone https://github.com/JaimeRC/node-vs-golang.git\n\n2. Go to project folder:\n\n        cd node-vs-golang\n        \n3. Init docker-compose:\n   \n        docker-compose up\n        \n        Starting apigolang ... done\n        Starting apinode   ... done\n        Attaching to apinode, apigolang\n        apigolang     | 2020/10/21 13:44:14 Running on port 8080\n        apinode       | \n        apinode       | \u003e api-node@1.0.0 start /src\n        apinode       | \u003e node ./server/index.js\n        apinode       | \n        apinode       | Server listening to  7070\n\n    If you add the parameter `-d` it initializes in the background.\n \n4. In another terminal, start the tests: \n    - Node Server:\n   \n            bash bench.sh node\n            \n            Benching: http://localhost:7070/api\n   \n    - Golang Server:\n\n            bash bench.sh golang\n            \n            Benching: http://localhost:8080/api\n            \n5. After the tests, three files are created per server:\n    - Description the tests in `output_node.txt` (only the first is shown):\n    \n            Benching: http://localhost:7070/api\n            '1' concurrent user doing '100' page hits\n            This shows you how well the web-server will handle a simple load of '1' user doing a number of page loads.\n            \n            This is ApacheBench, Version 2.3 \u003c$Revision: 1843412 $\u003e\n            Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n            Licensed to The Apache Software Foundation, http://www.apache.org/\n            \n            Benchmarking localhost (be patient).....done\n            \n            Server Software:        \n            Server Hostname:        localhost\n            Server Port:            7070\n            \n            Document Path:          /api/test\n            Document Length:        Variable\n            \n            Concurrency Level:      1\n            Time taken for tests:   0.143 seconds\n            Complete requests:      100\n            Failed requests:        0\n            Non-2xx responses:      100\n            Keep-Alive requests:    100\n            Total transferred:      79900 bytes\n            HTML transferred:       900 bytes\n            Requests per second:    697.27 [#/sec] (mean)\n            Time per request:       1.434 [ms] (mean)\n            Time per request:       1.434 [ms] (mean, across all concurrent requests)\n            Transfer rate:          544.06 [Kbytes/sec] received\n            \n            Connection Times (ms)\n                          min  mean[+/-sd] median   max\n            Connect:        0    0   0.0      0       0\n            Processing:     1    1   0.6      1       6\n            Waiting:        1    1   0.6      1       6\n            Total:          1    1   0.6      1       6\n            \n            Percentage of the requests served within a certain time (ms)\n              50%      1\n              66%      1\n              75%      1\n              80%      1\n              90%      2\n              95%      2\n              98%      4\n              99%      6\n             100%      6 (longest request)\n            \n            =============================================================================================================\n\n    - Graph with the results per test in `node_test0.png` (only the first is shown):\n    \n        ![node_test0.png](./docs/node_test0.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimerc%2Fnode-vs-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaimerc%2Fnode-vs-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaimerc%2Fnode-vs-golang/lists"}