What version of Go are you using (go version)?
go 1.6.2 mac/amd64 What operating system and processor architecture are you using (go env)? GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/data/apps/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GO15VENDOREXPERIMENT="1" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common" CXX="clang++" CGO_ENABLED="1" What did you do? package main import ( "net/http" "strconv" "fmt" ) func main() { http.HandleFunc("/", httpHandler) http.ListenAndServe(":8001", nil) } func httpHandler(w http.ResponseWriter, r *http.Request) { b, _ := strconv.ParseBool(r.URL.Query().Get("loop")) if b { loop() } fmt.Fprintf(w, "ok") } func loop() { i := 0 for { if i == 10000 { i = 0 } i++ } } 1. curl http://127.0.0.1:8001/?loop=true 2. curl http://127.0.0.1:8001/?loop=false When the loop to the CPU processing and about 8 times the request, refused to all the HTTP request. What did you expect to see? export GODEBUG=schedtrace=1000 SCHED 1010ms: gomaxprocs=8 idleprocs=8 threads=6 spinningthreads=0 idlethreads=3 runqueue=0 [0 0 0 0 0 0 0 0] SCHED 2016ms: gomaxprocs=8 idleprocs=8 threads=6 spinningthreads=0 idlethreads=3 runqueue=0 [0 0 0 0 0 0 0 0] SCHED 3019ms: gomaxprocs=8 idleprocs=8 threads=6 spinningthreads=0 idlethreads=3 runqueue=0 [0 0 0 0 0 0 0 0] SCHED 4028ms: gomaxprocs=8 idleprocs=7 threads=6 spinningthreads=0 idlethreads=2 runqueue=0 [0 0 0 0 0 0 0 0] SCHED 5033ms: gomaxprocs=8 idleprocs=5 threads=6 spinningthreads=0 idlethreads=0 runqueue=0 [0 0 0 0 0 0 0 0] SCHED 6033ms: gomaxprocs=8 idleprocs=3 threads=8 spinningthreads=0 idlethreads=0 runqueue=0 [0 0 0 0 0 0 0 0] SCHED 7035ms: gomaxprocs=8 idleprocs=0 threads=10 spinningthreads=0 idlethreads=0 runqueue=0 [0 0 0 0 0 0 0 0] SCHED 8037ms: gomaxprocs=8 idleprocs=0 threads=10 spinningthreads=0 idlethreads=0 runqueue=1 [0 0 0 0 0 0 0 0] SCHED 9044ms: gomaxprocs=8 idleprocs=0 threads=10 spinningthreads=0 idlethreads=0 runqueue=1 [0 0 0 0 0 0 0 0] SCHED 10050ms: gomaxprocs=8 idleprocs=0 threads=10 spinningthreads=0 idlethreads=0 runqueue=1 [0 0 0 0 0 0 0 0] SCHED 11059ms: gomaxprocs=8 idleprocs=0 threads=10 spinningthreads=0 idlethreads=0 runqueue=1 [0 0 0 0 0 0 0 0] SCHED 12060ms: gomaxprocs=8 idleprocs=0 threads=10 spinningthreads=0 idlethreads=0 runqueue=1 [0 0 0 0 0 0 0 0] -- 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.