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
Currently, in PHP, it allows setting a memory limit per a request. We also have worker scripts that restart based on the number of requests. Inspired by https://externals.io/message/126226, it may make sense to measure memory usage per the limit to handle potential memory leaks.
This needs a few things working together: GOMEMLIMIT for keeping the Go runtime in check, memory_limit ini settings, and the current container/cgroup memory limits (plus current number of threads).
From that, we can derive if a request is going to potentially exceed those limits, we can start a rolling restart of workers before handling the request. If after restarting the workers, and we are still brushing up against the limits, then we can assume there is a memory leak in go and we need to restart the entire process.
Note: this could also be an autoscaling strategy (density vs. speed)
The text was updated successfully, but these errors were encountered:
Describe you feature request
Currently, in PHP, it allows setting a memory limit per a request. We also have worker scripts that restart based on the number of requests. Inspired by https://externals.io/message/126226, it may make sense to measure memory usage per the limit to handle potential memory leaks.
This needs a few things working together:
GOMEMLIMIT
for keeping the Go runtime in check,memory_limit
ini settings, and the current container/cgroup memory limits (plus current number of threads).From that, we can derive if a request is going to potentially exceed those limits, we can start a rolling restart of workers before handling the request. If after restarting the workers, and we are still brushing up against the limits, then we can assume there is a memory leak in go and we need to restart the entire process.
Note: this could also be an autoscaling strategy (density vs. speed)
The text was updated successfully, but these errors were encountered: