Announcement

#1 2015-01-22 13:00:57

mathias
Member
2011-12-11
10

Memory pressure on VPS with 128RAM

Hi Piwigo team,

thanks for this really nice photo gallery. I am using it since a few years on my VPS to share some family photos and I really like all the options you guys coded in PHP for it.

Lately I have some issues on my VPS with 128 RAM after upgrading to the latest version 2.7.3. I uploaded some photos into the galleries folder without generating the corresponding thumbnails.

When the gallery is viewed I constantly get in dmesg Out of memory in UB: OOM killed process error message and OOM kills the mysql db process. I think this is because I haven't generated the thumbnails for different image sizes.

I have already lowered the PHP memory limit and changed to imagemagick, tried to amend vm.swappiness but none of this has resolved this issue.

I also wonder why Piwigo generates thumbnails and different image sizes at all? This takes up a lot of space, would it not be possible to simply use the original image and use CSS rules to display it accordingly to the device?

Thanks,

Mathias

Last edited by mathias (2015-01-22 13:05:46)

Offline

 

#2 2015-01-22 13:09:49

flop25
Piwigo Team
2006-07-06
7037

Re: Memory pressure on VPS with 128RAM

a simple question: do you to download dozen of HD pictures on a single web page on mobile?

also you need to increase not to decrease the memory limit
you can generate resized pictrues locally ; many threads about that


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2015-01-22 13:20:32

mathias
Member
2011-12-11
10

Re: Memory pressure on VPS with 128RAM

Ok Flop25, many thanks for your prompt reply. I searched the forum before and couldnt find an exact explanation for my error message so I thought it would make sense to post this. I know you can create the thumbnails locally. I will give it a try. Thanks for your reply.

Could you please also explain me why images are resized at all? The thumbnails make sense to reduce bandwith but the other versions?
I thought a CSS rule can be used so the image scaling is run on the client side instead of using server resources.

Offline

 

#4 2015-01-22 13:31:43

flop25
Piwigo Team
2006-07-06
7037

Re: Memory pressure on VPS with 128RAM

mmh yeah don't know why Google, facebook ect didn't thought that too...
let me remind you that the picture is resized only once, that's all, not for each visitors


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2015-01-22 13:38:48

mathias
Member
2011-12-11
10

Re: Memory pressure on VPS with 128RAM

Yeah makes sense Flop25.  It is being generated once for example for an IPAD retina.
It will be generated another time for an IPAD 2 with a lower resolution screen.

In the end you will have multiple copies of the same image and they obviously take up space.
Currently my VPS has 20GB but when I estimated the amount of pictures I can store I only took into consideration the HD versions...

Maybe I spend some time in the future to change the source code to not use the resizing at all so that you always use hd images except for the thumbnails. I have unlimited bandwitch but only 20GB space...


Thanks,

Mathias

Last edited by mathias (2015-01-22 13:40:52)

Offline

 

#6 2015-01-22 17:06:01

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Memory pressure on VPS with 128RAM

Hi mathias,

If you use Piwigo default settings for photo sizes, the "multiple sizes" cache should not take that much space, compared to your original photos. If your photos are 10MB each (which is very common nowadays), an XXL will take less than 1MB, M-size around 300KB (these are approximate values)

If you don't like the multiple sizes, you can limit this features: go to [Administration > Configuration > Options > Photo sizes], and uncheck all sizes but M.

Multiple sizes are absolutely necessary for a photo manager like Piwigo. Maybe you don't need the 9 sizes, but at least a thumbnail and the M size (equivalent as Piwigo prior to version 2.4).

Now about the memory required, I think 128MB is very small. The ImageMagick "convert" script may need more than that, depending on the size (in pixels) of your original photo.

If you upload very small original photos (smaller than the configuration of the M size) then Piwigo won't generate a M size and display directly your original photo.

Offline

 

#7 2015-01-22 23:11:44

mathias
Member
2011-12-11
10

Re: Memory pressure on VPS with 128RAM

Hi PLG,

Thanks for your help.
Excellent answer, have a nice evening

Offline

 

#8 2016-01-02 22:30:48

mathias
Member
2011-12-11
10

Re: Memory pressure on VPS with 128RAM

http://piwigo.org/forum/viewtopic.php?id=26195 can be used to disable multiple sizes completely.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact