valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.91k stars 1.76k forks source link

Panic when sending a lot of requests #1693

Closed AkramHssaini closed 10 months ago

AkramHssaini commented 10 months ago

I'm currently facing an issue while attempting to handle a considerable number of requests simultaneously. I've observed that my code runs smoothly for the initial half-hour, but subsequently encounters a panic error. Despite experimenting with different configurations for 'maxIdleConnections' and 'maxConnsPerHost,' I have been unsuccessful in resolving the problem. Unfortunately, the application consistently panics after approximately 30 minutes of execution.

I'm sending requests with a "keep-alive" header

client := &fasthttp.Client{
  Dial:                fasthttpproxy.FasthttpHTTPDialerTimeout("user:pass@ip:port", time.Second*15),
  MaxConnsPerHost:     100000,
  MaxIdleConnDuration: 1 * time.Hour
}

Im using 1000 threads