Announcement

#1 2009-03-05 00:18:59

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

pLoader behavior with external problems

I've simulated some problems on the server side while trying to transfer photos with pLoader 2.0.0b.

1. limit on the request maximum size

In the php.ini configuration file, I've set the post_max_size to 2M (instead of 8M by default on my Linux server).

When pLoader tries to upload a photo that is bigger than the post_max_size, pLoader is on error (for this specific photo) with:

1 images in errors and not uploaded - 501 Missing "method" name (duration 31 seconds)

2. limit the PHP script input time

This time I have decreased the max_input_time from 60 to 10 seconds (still in the php.ini configuration file), I also have used Wondershaper to downgrade the network connection speed to be sure the transfer duration will exceed the max_input_time I had set.

It was a suprise but no problem occured. pLoader total duration time to transfer 1 photo was 37 seconds (with at least 35 seconds for transfer) and the upload was successful.

2. limit the PHP script execution time

This time I have decreased the max_execution_time from 30 to 10 seconds (still in the php.ini configuration file), still use Wondershaper to downgrade the network speed.

I was not surprise that no problem occured, simply because as soon as the POST request has completely arrived (with the big parameter, ie the content or your photo) the script itself doesn't do many thing : dump the file content into a file on disk, perform 2 SQL queries and that's all folks.

Offline

 

#2 2009-03-19 21:41:06

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

Re: pLoader behavior with external problems

pLoader 2.0.1a has a nice update : it chunks the files to upload so that you don't reach any limit on your network. Then Piwigo merges the chunks into a single file. While I was limited to approximately 5MB (often reached with my DSLR), I can now upload much bigger photos.

Another problem that I discovered while chunking the input files, is that if your photo is really big, you can reach the PHP memory limit on your server, because the base64 decoding process requires to load the entire file in memory. I(m trying to avoid this complete load, see details in [Bugtracker] ticket 949

For example, if you have memory_limit set to 16MB (in php.ini file), that your photo weights 7MB, then it will weights 10MB base64 encoded and it will load at least 17MB in memory (base64 encoded + base64 decoded strings), and 16MB are not enough. The web API fails, but pLoader shows no error. Your photo is just not loaded.

Offline

 

Board footer

Powered by FluxBB

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