This codebase is created to compare the performance of web servers implemented in Golang and Node.js. The comparison includes three different setups:
- Golang web server
- Node.js web server without worker clustering
- Node.js web server with worker clustering
The goal is to analyze and benchmark the performance differences between these implementations under varying levels of load.
To run load tests on your machine, follow these steps:
Make sure you have the following installed on your system:
- Golang
- Node.js
- ab (Apache benchmark tool for running benchmarks)
- Clone this repository to your local machine.
- Navigate to the root directory of the repository.
$ cd golang
$ go run main.go
$ cd nodejs
$ node index.js
$ cd nodejs
$ node index.js
Close all running applications, then run the following commands to run load test on each web server
Load Test on Golang Webserver
$ ab -n 2000 -c 50 http://127.0.0.1:4000/
Load Test on NodeJs Webserver(Without Worker)
$ ab -n 2000 -c 50 http://127.0.0.1:3000/
Load Test on NodeJs Webserver(With Worker Cluster)
$ ab -n 2000 -c 50 http://127.0.0.1:8000/calc