I'm doing a simple load test with Apache JMeter. My ambition was to 
benchmark a go server. Here is the code I've been using, its a simple web 
server

package main


import (
 "fmt"
 "log"
 "net/http"
 "runtime"
)


func handler(w http.ResponseWriter, r *http.Request) {
 fmt.Fprintf(w, "welcome")
}


func main() {
 runtime.GOMAXPROCS(runtime.NumCPU())
 http.HandleFunc("/function", handler)
 log.Fatal(http.ListenAndServe(":8080", nil))
}

When i test the JMeter with 5000 users with Ramp Up Period 1s, Loop Count 1 
as stated below

[image: Screenshot_27.png]

The result is as follows, it has *around 20% error rate* for the HTTP 
requests. 

[image: Screenshot_28.png]

When i examine the reason for an error JMeter states that the *Connection 
was refused* by host.

I would like to know how to increase concurrency in here, at least not 
dropping the connections in that rate. If the server handler code was bit 
complex than this, the error rate is increasing to at least 80%.

I tried the same kind of scenario with Java NIO(*com.sun.net.httpserver*). 
It resulted better as it had a lower error rate. But it caused a high 
latency when the work is done(Tested with same load).

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to