The Client's Transport typically has internal state (cached TCP connections), so Clients should be reused instead of created as needed. Clients are safe for concurrent use by multiple goroutines.
Im fixed this problem with http.Server.IdleTimeout parameter in my application. But this means that each request now opens a new connection.
I think it would be better if we reused the client.
Hello. We using gorush in our stack, and i see how my service instance memory usage and goroutines count grows constantly.![image](https://github.com/appleboy/gorush/assets/3951176/968d3709-2d7e-4065-b44c-34994c3ca174)
After a lot of debugging i found that GoRush initialize new
http.Client
for every feedback request: https://github.com/appleboy/gorush/blob/master/notify/feedback.go#L56There is a line in documentation:
Im fixed this problem with
http.Server.IdleTimeout
parameter in my application. But this means that each request now opens a new connection.I think it would be better if we reused the client.