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
Very high CPU and swap space usage. #120
Comments
Some interesting log lines (I can send you the full log by email).
Edit: log sent to the contact email on https://haschek.solutions/ |
Here's a stackoverflow answer for a fix: https://serverfault.com/questions/479443/php5-fpm-server-reached-pm-max-children But I don't know if that's the issue, since it seems like the webp conversion might be leaking memory or something. |
Some error messages:
LOTS of these ones:
|
hmm yes looks like a problem with the jpg to webp conversion. pictshare.net is running the same docker image with 6m hits a week and 30k images and I have no such issues. Your "Operation timed out" error seems to confirm that something is running that uses a large amount of ressources. How much traffic are you seeing? |
Not sure about the traffic, especially because pictshare is down now and we dont have any proper monitoring. My guess is less than 10 requests/s on average (with spikes when a user first opens the page). |
One thing, I removed a large picture, (~20 MB), and it stabilized A LOT (down from using 2GB of swap, to 20 MB of swap), but there's still a memory leak somewhere, the swap usage is still rising. |
This image might be the one that broke it: https://commons.wikimedia.org/wiki/File:Pizigani_1367_Chart_10MB.jpg |
The reason seems to be that behind the scenes the php-gd library is mapping the images pixel by pixel (basically BMP in RAM) which blows up on larger images. Takes a over a gig of ram to convert the 10mb jpeg you linked. Until we have a better conversion rate. I also tested cwebp on a server it took about two minutes and used half a gigabyte of RAM to convert the same photo to webp. Seems the only way to go to make it work is increased RAM and higher timeouts |
I'm getting really high CPU usage, and swap space being used up on my server all of the sudden from pictshare (I'm using the docker image). pictshare has about 5000 pictures, and has had no issues until now. Might be a memory leak?
I just checked and no new files are being added to the pictshare folder, so no uploads are taking place either.
The text was updated successfully, but these errors were encountered: