[go-nuts] Re: HTTP requests bottlenecks

2017-02-08 Thread emartinez1847
any idea? El miércoles, 1 de febrero de 2017, 23:26:07 (UTC-3), emarti...@gmail.com escribió: > > Hello, > > I'm writing a POC for a future RTB platform. Basically I'm doing stress > tests by receiving HTTP requests and performing HTTP GET requests in the > background. > > Issue I face is that

[go-nuts] Re: HTTP requests bottlenecks

2017-02-02 Thread emartinez1847
Ben, you are correct the dial thing, not sure how that ended up commented. Anyway, I've removed the custom dial (and tried with the timeout enabled as well), it did increase r/s a lil bit (5%-10% or so) but it increased the amounts of timeouts on the remote urls as well. El jueves, 2 de

[go-nuts] Re: HTTP requests bottlenecks

2017-02-02 Thread James Bardin
First things I notice are that you're overriding the default dialer with one that doesn't timeout, and you've commented out ReadTimeout in the client. Both of those could indefinitely hold up client connections regardless of the DoTimeout call, which just ensures that the Do function returns

[go-nuts] Re: HTTP requests bottlenecks

2017-02-02 Thread emartinez1847
Thanks for the answer. Yes, it seems to be blocking, I just fixed it with: http://blog.sgmansfield.com/2016/01/the-hidden-dangers-of-default-rand/ After that change my code is working a lil bit better but still I see a ton of timeouts + high latency on responses. Maybe the code is locking on

[go-nuts] Re: HTTP requests bottlenecks

2017-02-01 Thread landivar
func randInt(min int, max int) int { rand.Seed(int64(time.Now().Nanosecond())) return min + rand.Intn(max-min) } Is the culprit. the default rand locks globally for concurrent access. You need to create a new rand in each goroutine you want to use it in, for maximum speed. On Wednesday,