I'm trying to figure out how it might be I have 5600 rps even with simple "Hello World" response. I tried starndard net/http, echo and fasthttp. Here is an example of the latter:
func main() {
router := routing.New()
router.Get("/", func(c *routing.Context) error {
fmt.Fprintf(c, "Hello, world!")
return nil
})
panic(fasthttp.ListenAndServe(":7777", router.HandleRequest))
}
I use ab and wrk for testing. Here is wrk command:
$ wrk -t10 -c100 -d10s http://somesite.com
Running 10s test @ http://somesite.com
10 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 17.05ms 1.08ms 33.46ms 91.30%
Req/Sec 587.80 33.97 670.00 84.92%
58603 requests in 10.10s, 8.27MB read
Requests/sec: 5802.71
Transfer/sec: 838.67KB
I tried on two different servers. One of them is a simple Digital Ocean instance, but another is dedicated with 32G RAM, 8 cores and 1Gb network channel. The results are the same for both servers. I run fasthttp application on one of them and wrk on another, and wise versa.