You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The HTTP executor seems to be creating new http.Clientfor every job execution. This causes 2 types of problems:
(Minor) Poor response times or job execution times because new connections are created every time instead of utilising connection pool maintained by http.Client
(Major) If the server supports Keep Alive connections, repeated job executions end up creating multiple persistent idle connections to the target host eventually causing file-descriptor limit breach on the server side. (If the server handles the timeout on idle connections properly or sends a Connection: close on every response, this is handled. But it would still be ideal to handle this properly from the client)
Describe the solution you'd like
Re-use the http.Client instance in the HTTP executor and allow configuring MaxIdleConns and MaxIdleConnsPerHost configs of the http client. (Handling TLS configs would be slightly tricky I think -- But may be it would at least help if the client instances can be cached against Job ID)
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
I agree with this issue, we had a goroutine/memory leak, because the TCP connections were kept alive, but the client was not reused, so the resources weren't freed on the server side.
A Connection: close header solves this, but it shouldn't be necessary if dkron reuses the client.
Is your feature request related to a problem? Please describe.
The HTTP executor seems to be creating new
http.Client
for every job execution. This causes 2 types of problems:http.Client
Connection: close
on every response, this is handled. But it would still be ideal to handle this properly from the client)Describe the solution you'd like
Re-use the
http.Client
instance in the HTTP executor and allow configuringMaxIdleConns
andMaxIdleConnsPerHost
configs of the http client. (Handling TLS configs would be slightly tricky I think -- But may be it would at least help if the client instances can be cached against Job ID)Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: