my net/http post method give 100% cpu usage

(sambal) #1

I have a web server with net/http and julienschmidt/httprouter. I don’t know why, but if I post a “big” data, like hundred of newline from <textarea> , my go server dies.

I already tried to use goroutine to make for _, value := range target exclude from main thread and try to increase ulimit, but it seems doesn’t work code:

(Johan Dahl) #2

Try moving helper.DataDatabase() out of the for range loop. If it does make a new connection to the database (I don’t know just guessing) it is a very expensive operation.