Announcement

#1 2014-10-29 22:19:04

JT
Guest

PIWIGO crashes freezes servers

Hello/Hi/Greetings,

I have piwigo so far on 3 different servers and have the same problem everywhere. It can literally KILL the server completely when adding a bunch of photos or even not so many photos if they are very high resolution. I assume that GD or imagick convert is to blame, on some I use GD, on one i use current piwigo 2.7.1 defaults on server where 'convert' is not available (so GD?), on another i explicitly use ext_imagick convert. You really need  to FIX this bad implementation of thumbnail/square/etc creation. Maybe you could either stop concurrent processes/threads and just let convert/GD run only once at a time, or use 'nice' settings on the threads or some other solution so that it does not bring a server to its knees. Any other method of accomplishing the same goal would be welcome.

Also, batch upload through the browser needs HTML5 compliant method that can deal with apache htaccess since Flash uploaders can NOT work with apache htaccess apparently. For me the best method of adding photos is still by FTP and then doing a SYNCHRONIZATION even though you seem to discourage this method. You should not discourage this method when you don't have a good alternative, as I mentioned for me the FLASH uploader is unusable due to htaccess security. Also some systems may not even have FLASH installed. Perhaps you can embed some kind of web interface FTP client for batch album uploads. And please consider keeping the current FTP synchronization feature for the future also, its very convenient for many of us and makes organizing our albums much easier/logical, just put them in /galleries/ folder the way we want and click sync. This is a GREAT feature not something bad that should be made obsolete unless something else that works just as well can be introduced, ie non-flash based, FAST like FTP and works with htaccess etc.

Another recommendation is to make it so that running out of space doesn't mess things up so badly. On one installation I ran out of space while it was creating thumbnails+squares etc etc and it killed mysql and also thumbnails that were created but created corrupt made it so they did not show up but also did not recreate themselves when using Batch-generator, I had to find and manually delete the corrupt thumbnails and then re-run Batch manager. I also ended up needing to fix some mysql problems but was able to get the server back up and running. So perhaps some filesystem space checks/warning would be good to add.


Piwigo version: 2.7 and 2.7.1
PHP version: 5.x (current stable)
MySQL version: 5.x
Piwigo URL: http://

 

#2 2014-10-29 22:28:59

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: PIWIGO crashes freezes servers

Hi

FTP sync absolutely not planned for removal, why do you even worry ?
yes we promote browser upload because more covenient but FTP won't disappear

also, Piwigo 2.7 DOES use HTML5 upload, we totally removed the Flash uploader, only the Community plugin still use Flash upload for various reasons (I don't know)

Offline

 

#3 2014-10-29 22:38:35

JT
Guest

Re: PIWIGO crashes freezes servers

Hi,

Thanks for the quick reply. Great to hear FTP/Synchronization won't be deprecated, the way it was discouraged in some places in favor of web upload made me think that.

But the main problem as I've mentioned is that the current way that thumbnail/squares/multiple-sizes etc is implemented it can easily overpower the server and bring it to its knees, freeze it, even crash it where you have to reboot. I've found that I'm not the only one experiencing this, and neither switching from GD or imagick makes much of a difference. I think piwigo needs to start controlling more strictly the imagick convert of GD processes so they are not allowed to kill the server whether due to disk IO or CPU or both.
I've mentioned a couple methods such as "nice" setting for processes or limiting so that only one image is processed at a time, or limit on number of concurrent convert processes/threads. There could be other even better methods I don't know of, I'm just hoping a solution to this will be possible soon. Looking forward to hearing back in regards to this, thanks

Also, where is the HTML5 upload that allows uploading more than one photo at a time though? I can't seem to find it, on my install I do have a flash uploader where I can shift-select multiple files and upload that way, but if I click on the alternative web upload it only allows one photo at a time. Also the speed of upload does not compare with FTP.  Oh, also, I did install the Community Plugin since I usually require photogalleries to allow for members to upload photos also, not just the administrator, so I see the Community Plugin as the most important plugin, one that should probably be installed by default.

 

#4 2014-10-29 22:41:35

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: PIWIGO crashes freezes servers

Admin / Photos / Add ... obvious location


If you don't have this uploader http://www.plupload.com/examples/queue well I'm sorry to tell you that you are not in 2.7 :-)


I don't react on your main concern because I don't have any knownlege in this kind of stuff, I don't even know if it is possible (I highly doubt on shared hosts)

Offline

 

#5 2014-10-29 22:55:10

JT
Guest

Re: PIWIGO crashes freezes servers

All my Piwigo installs are on my own servers not shared servers. Actually shared servers have their own 'CPU throttling' and software to limit users so that piwigo or other software won't crash their shared servers and affect hundreds of users and so that one user doesn't hog up all the server's resources. Dedicated servers do not have all this CPU throttling/limiting etc and so will give piwigo/convert/GD as much as it asks until sometimes it crashes the server.

On one of my servers right now I can't login to remotely anymore so I will have to reset the power switch on it. It got killed after I added some photos when it started to try and make usual thumbnails etc...

Anyway, hopefully you can pass on my feedback in regards to this to the developers on the piwigo team who may be able to work on this, I can be contacted directly if they need any more details or feedback.

I will look for the ploader you mentioned, perhaps its a plugin I didn't enable or something or maybe I was trying to upload with Community Plugin into my 'user' gallery, the community plugin does not have the HTML5 Batch upload loader?

 

#6 2014-10-30 00:02:49

JT
Guest

Re: PIWIGO crashes freezes servers

Well after I did a power off/on reset, server rebooted ok but as soon as i tried to load the piwigo gallery in browser it started to freeze up, so I'm not sure if gd processes are re-triggered on html load or what's going on since I can't really run any commands like top or ps aux etc due to server being unresponsive.

--UPDATE ok after second reboot, and retrying to load piwigo in browser, was again unresponsive but after a long time finally it loaded, although seems no thumbnails are loading for the albums and if i click on an album, again it becomes unresponsive taking forever to load. --update still unresponsive, i may have to reboot yet again.

Also found this somewhat different performance issue someone else posted:
http://piwigo.org/forum/viewtopic.php?id=23686

I'm hoping performance can be improved in upcoming releases and will especially be looking forward to a workaround to the image resizing/thumnails/etc thrashing/crashing servers issue.  Thanks.

 

#7 2014-10-30 00:58:35

JT
Guest

Re: PIWIGO crashes freezes servers

By the way, in case it helps, a lot of the images are 9MB in size mostly, but varies 5MB to 10MB although a few rare JPEGs can be as high as 18MB or 2OMB. Many are very high resolution, 7360 x 4912 being the highest resolution, others a bit lower than that.

 

#8 2014-10-30 01:20:43

JT
Guest

Re: PIWIGO crashes freezes servers

I found another thread on here basically discussing the same issue:

http://piwigo.org/forum/viewtopic.php?id=22348

As you can see even on your own recommended hosting provider, they were trying to ban i.php due to CPU %load abuse.

I can time after time replicate these issues basically 100% of the time on different servers, with default install of a fresh new piwigo installation, uploading a gallery directory to /galleries/ subdirectory  and then just try to access the gallery, go to batch manager and it becomes unresponsive due to the image resizing etc taking place. Many times end up having to reboot the server to be able to log back in.

Anyway, I hope this documentation and references will help prove this is a legitimate problem that needs to be fixed, soon hopefully. I'm open to testing out any patches etc, and can be contacted directly by the developers. Thanks.

 

#9 2014-10-30 05:18:29

JT
Guest

Re: PIWIGO crashes freezes servers

In hopes to be more useful in helping in the process of a solution to this, I've done some research on imagick 'faster' alternatives.

Please note that I think the real solution to this problem is how Piwigo and i.php is called and how it in turn calls and controls image resizer processes such as /usr/bin/convert or others. So although I would like to see some of these other resizers supported by piwigo such as epeg and gm (GraphicMagick) and Econvert (ExactImage), or others, UNLESS somehow these other resizers/converters are a lot smarter and can monitor themselves and IO/CPU usage or set nice levels etc, it will still be necessary for piwigo itself to CONTROL these processes and don't let them get 'out of control' such as they consume 100% of a server's resources and crash the server, as is happening currently on all of my piwigo installs even with just "one" user, due to multiple image uploads and the resulting spawning of resize/convert/gd etc to create the multiple size images and thumbnails.

I hope to hear a response in a day or two from the developers in regards to this issue to see if it will be taken seriously and given high priority. If not I'm left without much options, either drop piwigo from any installation and go with other gallery software, some of which I've used before (not polite to list here), or perhaps I will create a "fork" of piwigo and start a version of piwigo that will address these issues and take it in a direction more in line with my needs emphasizing robustness. My hope is that this will be fixed in piwigo itself. Thanks!

Here's some of the more interesting links from my online research on FAST jpeg resizers versus GD/imagick (I'd highlight EPEG, GraphicsMagick, Econvert, and VIPS for now):

GM PECL plugin or VIPS http://www.collectiveaccess.org/support … acement/p1
Graphicsmagick vs imagemagick http://codeascraft.com/2010/07/09/batch … of-images/
https://github.com/mattes/epeg
epeg http://www.systhread.net/texts/200507epeg1.php
VIPS fast http://www.vips.ecs.soton.ac.uk/index.p … Memory_Use
ECONVERT drop-in replacement for imagick convert http://www.exactcode.com/site/open_sour … /econvert/
GraphicsMagick optimized http://www.kitchensoap.com/2009/04/03/s … nterestin/
GraphicsMagic vs Imagemagick P2 http://sourceforge.net/p/graphicsmagick … stems.org/   

convert with mogrify or epeg http://leocharre.com/articles/faster-im … -in-linux/
http://packages.ubuntu.com/lucid/exactimage-perl

node.js so can facilitate client/browser-side thumbnail creation and upload? https://github.com/lovell/sharp
in referece to above see also http://stackoverflow.com/questions/2303 … ml5-canvas
http://fir4j.sourceforge.net/

http://agschwender.github.io/pilbox/    https://github.com/agschwender/pilbox  OR thumbor http://thumbor.org/
http://developers.lyst.com/data/images/ … /openross/    https://github.com/ssaw/openross   https://news.ycombinator.com/item?id=7931744

http://www.libjpeg-turbo.org/
http://stackoverflow.com/questions/1139 … than-hours
http://www.kitchensoap.com/2009/04/03/s … nterestin/
http://superuser.com/questions/315885/f … ge-resizer
http://stackoverflow.com/questions/1176 … ssed-image
good for benchmarking various resizers https://github.com/fawick/speedtest-resize
http://vanillaforums.org/discussion/639 … resize-jpg
services https://imageshack.us/pages/resize/
https://github.com/jruby/jruby/wiki/C-E … ternatives
http://www.thebuzzmedia.com/software/im … g-library/
http://www.graphicsmagick.org/benchmarks.html

 

#10 2014-10-30 09:14:25

JT
Guest

Re: PIWIGO crashes freezes servers

Possible interim solution proposal:
Create THUMBNAILS/squares/L/S/XL/etc resized images on another system and then UPLOAD the resulting images.
Recomend that the thumbnails for various settings woudl be put in separate directories or give specifics on location and naming structure and how we can disable auto-generation once we upload already created thubnails etc..Is this info and method already fully documented somewhere?

For those opting for this method there are some GPU solutions I've come across which should be much faster since they use GPU/CUDA/OpenCL etc:
https://imageresizergpgpu.codeplex.com/

Now going back to the more realistic solution, back to server-side resizing, another library I found is:
imlib2 which supposedly is pretty FAST also.

more votes for EPEG http://superuser.com/questions/249646/f … -for-linux
https://github.com/mattes/epeg

http://stackoverflow.com/questions/4868 … using-perl
http://search.cpan.org/dist/Image-Imlib … umbnail.pm

http://www.manpagez.com/man/1/vipsthumbnail/
https://github.com/jcupitt/libvips   http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS
vips discussion [Github] sharp issue #41
SWIGGLE might be interesting http://homepage.univie.ac.at/l.ertl/swiggle/
interesting http://stackoverflow.com/questions/1172 … erformance
benchmarking https://gist.github.com/488401/9406e78f … d25bc51371

Anyway seems that VIPS and imlib2 and especially EPEG are worth looking into supporting, and also restructuring how these resizers whether imagick/gm/gd or other are called and controlled to prevent "abuse" over-consumption / overload of system resources leading to server freeze, crash...

 

#11 2014-10-30 09:15:45

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

Re: PIWIGO crashes freezes servers

Hi JT,

I assume that the sync itself works fine, it's just the fact that when you open the album on gallery side, Piwigo has to generate 15 (or more) thumbnails at once from the original photo. Try this method:

1) in the sync, only apply to directories, it will create empty albums if new directories are found

2) on page [Administration > Albums > Properties > Lock], lock albums where you know there are new photos

3) go back on [Administration > Tools > Synchronize] and now synchronize directories+files

4) on page [Administration > Photos > Recent Photos], it will have to generate 20 thumbnails, but not more. Select "the whole set" and use the action "generate multiple size images", first generate size M, then size Thumbnail. Resized photos will be generated one by one, avoid to take to much CPU on your server.

5) on page [Administration > Albums > Properties > Lock], unlock albums

Tell us if this workflow makes things better for your server.

Offline

 

#12 2014-10-30 09:27:33

flop25
Piwigo Team
2006-07-06
7037

Re: PIWIGO crashes freezes servers

you can already genertae the resized pictures locally and then upload them ; already discussed several times


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

 

#13 2014-10-30 09:30:45

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

Re: PIWIGO crashes freezes servers

flop25 wrote:

you can already genertae the resized pictures locally and then upload them ; already discussed several times

Hi flop25,

Do you know if there is a script provided to generate the resized photos before upload?

Offline

 

#14 2014-10-30 09:36:47

flop25
Piwigo Team
2006-07-06
7037

Re: PIWIGO crashes freezes servers

hmm don't remember something like this that someone published or posted
if you do, you could post in the wiki


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

 

#15 2014-10-30 19:17:29

JT
Guest

Re: PIWIGO crashes freezes servers

Hi Plg,

Thanks I'm trying to figure out the steps you listed.

I've just done step 1) you listed.

Step 2) : Done also

Step 3) : Done also

Step 4) : Here maybe not as planned? I clicked on Photos->Recent Photos and at the top it says predefined filter latest import and lower it says 85 photos in current set none selected, and the browser circle thing is keeping moving and I can hear hard drives crunching, I think that whenever I go to this page or to the "Batch Manage" page, that it automatically starts crunching to show me those square previews of images on these pages.

But at least so far i haven't lost control of server so maybe it is doing less resizing at a time etc..
when this "Crunching" is all done is when I can do step 5) and unlock album?

Is there a good writeup on file names/structure etc for producing the thumbnails on windows etc and just uploading them also to server so the server doesn't try to make them? Although I still think there needs to be a fix for this so server can do only one by one but without going through all those steps each time that you mentioned. Looking forward to such a fix. Thanks!

 

Board footer

Powered by FluxBB

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