DEV Community

Rajan lagah
Rajan lagah

Posted on

NodeJS vs GoLang #1

Stress Testing a Nodejs and Go Server using the hey CLI tool.

๐Ÿ“ Case
โ€ข 1000 online users
โ€ข 2000 concurrent requests
โ€ข on a AWS t3.micro EC2 instance
โ€ข get a request with a simple Select query.
โ€ข same Postgres database on AWS RDS.

NodeJS Server
While it handled the load decently, 15 requests failed with a 502 error, and the total execution time was 2.4 seconds. All other 1985 requests pass successfully

GO Server
๐Ÿ”ฅ Go handled ALL requests with a 200 response!
โณ Total time?๐Ÿญ.๐Ÿฎ ๐˜€๐—ฒ๐—ฐ, Less than half of what Node.js took!

This proves why Go is a powerhouse for building high-performance, scalable servers. ๐Ÿš€
Check out the image for the detailed results! ๐Ÿ“Š

๐—•๐˜‚๐˜ ๐˜„๐—ฒโ€™๐—ฟ๐—ฒ ๐—ป๐—ผ๐˜ ๐—ฑ๐—ผ๐—ป๐—ฒ ๐˜†๐—ฒ๐˜!
๐Ÿ’ก In the next round, weโ€™ll run the test with medium-level traffic: 100 users sending 1000 requests. Also, check cases where NodeJS outperforms GO. Are you curious to see how both perform under different scenarios? Stay tuned! ๐˜›๐˜ณ๐˜ถ๐˜ด๐˜ต ๐˜ฎ๐˜ฆ ๐˜ต๐˜ฉ๐˜ช๐˜ฏ๐˜จ๐˜ด ๐˜ธ๐˜ช๐˜ญ๐˜ญ ๐˜จ๐˜ฆ๐˜ต ๐˜ค๐˜ณ๐˜ข๐˜ป๐˜ช๐˜ฆ๐˜ณ.

What are your thoughts on Go vs. Node.js for backend performance? Letโ€™s discuss in the comments! ๐Ÿ‘‡

P.S. Want to master Go and build ultra-fast web servers? Check out my Go Course on Udemy: https://www.udemy.com/course/go-web-development-create-powerful-servers-with-golang/?referralCode=EA9B71B7323D2C5D1071.

NodeJS vs GoLang

Top comments (0)