Update: Answered question with results from the web server hosted on VPS (Vultr)
I compared it against a NodeJS/Express server to achieve a point of comparison.
What have I done wrong?
Go server:
package main
import "github.com/gin-gonic/gin"
func main() {
gin.SetMode(gin.ReleaseMode)
router := gin.Default()
router.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
router.Run("0.0.0.0:9999")
}
Express Server:
const express = require('express')
const app = express()
app.get('/ping', (req, res) => res.send({ pong: 'pong' }))
app.listen(9999, () => console.log('Example app listening on port 9999!'))
Test
Tool was Vegeta
echo "GET http://localhost:9999/ping" | vegeta attack -rate=500 -duration=10s | vegeta report
Duration: 10s
Requests: 500 per s
Results
Go/Gin's Mean Response Time: 13000ms
Node/Express's Mean Response Time: 24ms