mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2026-04-26 07:25:55 +03:00
[GH-ISSUE #120] Very high CPU and swap space usage. #96
Labels
No labels
Feature request
Feature request
bug
cant reproduce
enhancement
help wanted
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pictshare#96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dessalines on GitHub (Jun 5, 2020).
Original GitHub issue: https://github.com/HaschekSolutions/pictshare/issues/120
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.
@Nutomic commented on GitHub (Jun 5, 2020):
Some interesting log lines (I can send you the full log by email).
Edit: log sent to the contact email on https://haschek.solutions/
@dessalines commented on GitHub (Jun 5, 2020):
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.
@dessalines commented on GitHub (Jun 5, 2020):
Some error messages:
LOTS of these ones:
@geek-at commented on GitHub (Jun 5, 2020):
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?
@Nutomic commented on GitHub (Jun 5, 2020):
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).
@dessalines commented on GitHub (Jun 5, 2020):
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.
@Nutomic commented on GitHub (Jun 5, 2020):
This image might be the one that broke it: https://commons.wikimedia.org/wiki/File:Pizigani_1367_Chart_10MB.jpg
@geek-at commented on GitHub (Nov 24, 2021):
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