-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Leak with invalid status code #316
Comments
nginx can rate limit request:
|
Rate limiting isn't the answer when there are actual memory leaks to contend with. I'm testing these patches on my install now. |
This issue ultimately prevented me from using the software. I ended up converting everything to webp in a preprocessing batch job. |
I'm running into this issue now with increased traffic -- every request is getting timed out with messages like:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thank you for this project.
I been testing this project in kubernetes with 100/200 Req/sec and with invalid status code (> 299) there are some problems with the memory and a lot of OOMKilled in a day(10-15).
I tested this PR updated with the current version of the branch main(#235) but it has other errors. (Probably channels closed)
This image is from prometheus with the current branch main.
Memory incrase until OOMKilled happens
I been trying some code modifications and this behavior changes when added this If (after this if https://github.com/willnorris/imageproxy/blob/main/imageproxy.go#L484-L487)
and this. https://github.com/willnorris/imageproxy/blob/main/imageproxy.go#L207
i moved it before this if.
I'm no sure if this status code validation works in all escenarios, but for me it works.
This is prometheus with this change(1 hour before vs 9 hour now)
The memory problem is still present, but the behavior is different.
I added "net/http/pprof" to try to find aditional strange behaviors.
and I found this.
It seems like a problem with cached request too.
I found this open PR https://github.com/gregjones/httpcache/pull/102/files
This is from pprof:
Heap: https://drive.google.com/file/d/1lH9oYfO_88EAAMdxEwZV1FrcNS-3CaN-/view?usp=sharing
goroutine: https://drive.google.com/file/d/1_jinUorbPVNLxEMrUbzXs5Z9ITT5_2MD/view?usp=sharing
Relates to: #97 #196 #92
The text was updated successfully, but these errors were encountered: