{"id":24564746,"url":"https://github.com/abzico/vperserv-loadteststats","last_synced_at":"2026-01-04T00:05:53.621Z","repository":{"id":144085036,"uuid":"141518081","full_name":"abzico/vperserv-loadteststats","owner":"abzico","description":"Share loadtest statistics result for VPER (https://vper.world in development) comparing NodeJS, and Go.","archived":false,"fork":false,"pushed_at":"2018-07-21T02:22:08.000Z","size":301,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T11:34:45.803Z","etag":null,"topics":["ab","apache-bench","load-test","loadtest","vper"],"latest_commit_sha":null,"homepage":"https://vper.world","language":null,"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/abzico.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":"2018-07-19T03:09:50.000Z","updated_at":"2018-07-21T02:22:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0f93aac-9353-4cd6-aff9-6b3d63a0d3cd","html_url":"https://github.com/abzico/vperserv-loadteststats","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/abzico%2Fvperserv-loadteststats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abzico%2Fvperserv-loadteststats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abzico%2Fvperserv-loadteststats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abzico%2Fvperserv-loadteststats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abzico","download_url":"https://codeload.github.com/abzico/vperserv-loadteststats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960444,"owners_count":20375101,"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":["ab","apache-bench","load-test","loadtest","vper"],"created_at":"2025-01-23T11:29:25.877Z","updated_at":"2026-01-04T00:05:53.593Z","avatar_url":"https://github.com/abzico.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# vperserv-loadteststats\n\nShare loadtest statistics result for VPER (https://vper.world in development) comparing NodeJS, and Go.\n\n# Objective\n\nThis loadtest focuses on compare general performance between NodeJS and Golang. Author didn't go fully overboard to optimize every aspect of backend code, but do so in certain level with more bias towards Go implementation one as author switches from NodeJS to Golang to prove the claim regarding to performance-wise.\n\n# How\n\nServer is Ubuntu 16.04 (4.4.0-91-generic) with 1G RAM, 1 single CPU 2.399 Ghz with 1 core located in Hongkong.  \nLoad-test client is macOS 10.13.4 High Sierra machine 8 GB Ram, CPU 2.5 GHz Intel Core i5; initiated from Shenzhen, China connected through VPN server which located in Hongkong to maintain its locality.\n\nLoad-testing uses Apache Bench (ab) which is pre-installed on macOS machine.\n\n\u003e This is ApacheBench, Version 2.3 \u003c$Revision: 1807734 $\u003e  \n\u003e Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/  \n\u003e Licensed to The Apache Software Foundation, http://www.apache.org/\n\nBoth NodeJS and Go server has similar functionality. Go is the port version from NodeJS as author switched to use but things done in Go's way.\n\n**NodeJS** =\u003e Node 8.10.0,  express 4.15.4, and pg 7.4.1  \n**Go** =\u003e Go 1.10.3, jackc/pgx (39bbc98), gorilla/mux (cb46983), valyala/fastjson (c58febb), valyala/quicktemplate (a91e094) \n\nThere are 2 categories of tests.\n\n## VerySmall - for empty result returned\n\nSee in directory `VerySmall` inside you will see results in each sub-directories categorized according to number of concurrent number.  \nThere are 7 sets of loadtests done for both NodeJS, and Go server testing against 76-bytes response, and 683481-bytes response as follows\n\n\u003e As testings are conducted from China mainland. It can be unstable that could significantly differ results especially in terms of total requests served as you could.\n\n1. Concurrent connection (C)=1, Test timelimit in seconds (T)=60s, Limit number of request (R)=1000000 ([see result=](https://github.com/abzico/vperserv-loadteststats/tree/master/VerySmall/C1))\n2. C=10, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/VerySmall/C10))\n3. C=100, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/VerySmall/C100))\n4. C=200, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/VerySmall/C200))\n5. C=300, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/VerySmall/C300))\n6. C=400, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/VerySmall/C400))\n7. C=500, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/VerySmall/C500))\n\nThus in total, we've conducted 28 tests.\n\n## Large - for 4947 items returned\n\n**Note:** This test is conducted after the first publishment of this repository so it has slightly more optimization like JSON string generated from within DB, and minor optimization code.\n\nAs result of such query statement will return somewhat large number of items that required server's resource to do the work. It's more reasonable to conduct concurrency up to level 5. [See Load Testing Basics: How many concurrent users is enough](https://www.webperformance.com/load-testing-tools/blog/2011/02/load-testing-basics-how-many-concurrent-users-is-enough/) to calculate what concurrent level should be enough for the game.\n\nI (optimisticly) use 100k visitors per month with 5 minutes on average session, and also divide by 12 hours to reach with 3,333.33 visitors / hour as I don't have clear statisitcs just yet to identify active hours. Then finally I reach with concurrent level of 2.314 (totally low compared to what I initially expect thus reasonable to test around this number). See above articlefor equation and explanation on how to calculate the number.\n\nThere are 4 tests (with no NodeJS test as I don't have time to reflect the implementation on NodeJS to be the same as in Golang; as this is done on-the-go after first publishment).\n\n1. C=1, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/Large/C1) - [graph](https://raw.githubusercontent.com/abzico/vperserv-loadteststats/master/Large/C1/graph.jpg))\n2. C=2, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/Large/C2) - [graph](https://raw.githubusercontent.com/abzico/vperserv-loadteststats/master/Large/C2/graph.jpg))\n3. C=3, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/Large/C3) - [graph](https://raw.githubusercontent.com/abzico/vperserv-loadteststats/master/Large/C3/graph.jpg))\n4. C=4, T=60, R=1000000 ([=](https://github.com/abzico/vperserv-loadteststats/tree/master/Large/C4) - [graph](https://raw.githubusercontent.com/abzico/vperserv-loadteststats/master/Large/C4/graph.jpg))\n\nSee results along with graphs in directory `Large`.\n\n## Data\n\nAPI end-point that serves incoming requests will make DB query in form `SELECT * FROM table WHERE x \u003e= $1 AND x \u003c= $2 AND y \u003e= $3 AND y \u003c= $4;` which is executed through prepared statement for performance. Such table at the time of load-testing has total number or records of 101447.\n\nIt responds back in JSON form as follows\n\n```json\n{\n    \"response\": {\n        \"count\": \u003cinteger\u003e,\n        \"rows\": [\n            {\n                \"field1\": \u003cstring\u003e,\n                \"field2\": \u003cstring\u003e,\n                \"field3\": \u003cint64\u003e,\n                \"field4\": \u003cint32\u003e,\n                \"field5\": \u003cint32\u003e\n            },\n            ...\n        ]\n    },\n    \"status_code\": 1,\n    \"status_message\": \"OK\"\n}\n```\n\nand according to input SQL Query we made, total size of response is `0.683481` MB with 4649 items in `\"rows\"` field.\n\n# `ab` command\n\nExecuted via `ab -t 60 -n 1000000 -c \u003cnumber of concurrent connections\u003e -k -H \"\u003ccustomheader\u003e:\u003ccustomvalue\u003e\" \u003curl-end-point\u003e`\n\nin which substitute parameter as need. Notice that `-k` to enable Keep alive connection, and `-H` to specify custom header as our application uses it.\n\nAlso `-t` needs to comes before `-n` to effectively make load-test session lasts for specified duration of 60s. Otherwise it will only lasts for 30s by default.\n\n# Result\n\nRoughly concurrent connection at 400-500 is the deminish point for Go as it's starting to have failed requests. But NodeJS has more severe and significant failure of requests much more than Go. At C=500, around 50% performance (in terms of number of requests served) dropped for NodeJS, but compared to Go; it's just slightly.\n\nKeep alive connection in HTTP as well plays an important role. If you disable without supplying `-k` in `ab` command, you will have much much less of requests served as shown in result.\n\n## Peak CPU \u0026 Memory Usage (per process, not whole server) for Concurrency connection of 500\n\n### 76-bytes\n\n| Server | CPU (%) | Mem (%) |\n| --- | --- | ---: |\n| NodeJS | 30.0 | 8.7 |\n| Go | 30.0 | 2.7 |\n\n# Last Word\n\nI hope this load-test statistics would be helpful to you. In case you have question regarding the test itself, contact [@haxpor](https://github.com/haxpor).\n\n# License\n\n[Apache License 2.0](https://github.com/abzico/vperserv-loadteststats/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabzico%2Fvperserv-loadteststats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabzico%2Fvperserv-loadteststats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabzico%2Fvperserv-loadteststats/lists"}