Build All Thumbnails/Resizes

Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Sun, 2005-06-05 09:15

I imported my albums from G1 to G2 and i would like to do all thumbnails and resizes but it fails every 25 to 50 pictures (I have 3342 pic) with folowing error:

Fatal error: Maximum execution time of 30 seconds exceeded in D:\WWW_Root\gallery2\modules\core\classes\GalleryPlatform\WinNtPlatform.class on line 109

I tryed changing execution time (240sec - 3600sec) in Php.ini and it does not make any diference it is still the same
----
Gallery version = 2.0-beta-3 core 0.9.17
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.0.54 (Win32) PHP/5.0.4
Database = mysql 4.1.11-nt
Toolkits = Exif, Gd, ImageMagick, SquareThumb, Thumbnail
Operating system = Windows NT MIHA 5.1 build 2600
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

any sugestions?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-06-05 16:09

Still the same 30 seconds? You need to restart Apache after making changes in the php.ini. At start-up that's the only time Apache reads the php.ini file.

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Sun, 2005-06-05 21:40

Yes i did restart apache after every change. My parametar in php.ini was never 30 sec to start with. What I'm saying is it is not problem with php.ini but with G2. Regardles what parametar I use I will alwayes get same error msg.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-06-05 21:49

i'm not into this issue, but my guess is that g2 extends the limit by 30 secs but the operation takes longer than another 30 secs.
maybe mindless can help here.

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Sun, 2005-06-05 23:42

i instaled the latest G2 and same thing happens with exception that now after 20 processed pictures i dont get error msg it just sits there doing nothing

Gallery version = 2.0-beta-3+ core 0.9.22
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.0.54 (Win32) PHP/5.0.4
Database = mysql 4.1.11-nt
Toolkits = Exif, SquareThumb, Thumbnail, Gd, ImageMagick
Operating system = Windows NT MIHA 5.1 build 2600
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Thu, 2005-06-09 08:28

Can anybody provide me with some insight in to this problem. Is this a bug or there is somthing wrong with my install. Please help?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-06-09 08:58

it's not a bug. maybe your server is just super slow and the the time we assume the task would need is chosen too small for your setup.
maybe a bug is involved.

 
lolworld

Joined: 2005-01-09
Posts: 4
Posted: Fri, 2005-06-10 01:00
Black_MDK wrote:
I imported my albums from G1 to G2 and i would like to do all thumbnails and resizes but it fails every 25 to 50 pictures (I have 3342 pic) with folowing error:

Fatal error: Maximum execution time of 30 seconds exceeded in D:\WWW_Root\gallery2\modules\core\classes\GalleryPlatform\WinNtPlatform.class on line 109

I tryed changing execution time (240sec - 3600sec) in Php.ini and it does not make any diference it is still the same
----
Gallery version = 2.0-beta-3 core 0.9.17
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.0.54 (Win32) PHP/5.0.4
Database = mysql 4.1.11-nt
Toolkits = Exif, Gd, ImageMagick, SquareThumb, Thumbnail
Operating system = Windows NT MIHA 5.1 build 2600
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

any sugestions?

Perhaps your server is a bit slow.
Go to Configuration Wizard, then click to Step 2 and select Technical Sheet.
Now change the default Time limit, which 30, to a higher number. My Server is a dual MMX266 NT4 Server and I have to set this to 90....
Then press next step and save the configuration.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-06-10 08:16

lolworld, you must be talking about Gallery 1. G2 doesn't have a configuration wizard or a technical sheet.
and Black_MDK already tried a higher execution time limit.

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Fri, 2005-06-10 09:39

One thing that might jog somebody’s memory is that ver 0.9.17 had a msg (look my first post) and ver 0.9.22 does not have any msg it just sits there doing nothing.
And about having super slow server, it might be but even with very fast server I would not expect to finish with 3000+ pictures in less then 1 min. My server (VIA Epia 1ghz 512MB ) currently does 10 pictures every time I run this task and it run for about one minute.

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Fri, 2005-06-10 10:46

Build All Thumbnails/Resizes
Processing image 180 of 3342

Estimated time remaining: 21:57
if( self.name == '' ) { var title = 'Console'; } else { var title = 'Console_' + self.name; } _smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes"); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write(""); _smarty_console.document.write("
Smarty Debug Console
included templates & config files (load time in seconds):
templates/global.tpl
gallery:modules/core/templates/ImmediateStatus.tpl (0.01053)
gallery:templates/debug.tpl (0.02569)
modules/core/templates/ImmediateStatusMessage.tpl (0.00888)
modules/core/templates/ImmediateStatusMessage.tpl (0.00871)
modules/core/templates/ImmediateStatusMessage.tpl (0.00871)
modules/core/templates/ImmediateStatusMessage.tpl (0.00863)
modules/core/templates/ImmediateStatusMessage.tpl (0.00866)
modules/core/templates/ImmediateStatusMessage.tpl (0.00888)
modules/core/templates/ImmediateStatusMessage.tpl (0.00867)
modules/core/templates/ImmediateStatusMessage.tpl (0.00875)
modules/core/templates/ImmediateStatusMessage.tpl (0.01425)
modules/core/templates/ImmediateStatusMessage.tpl (0.02141)
modules/core/templates/ImmediateStatusMessage.tpl (0.00952)
modules/core/templates/ImmediateStatusMessage.tpl (0.00929)
modules/core/templates/ImmediateStatusMessage.tpl (0.01070)
modules/core/templates/ImmediateStatusMessage.tpl (0.01094)
modules/core/templates/ImmediateStatusMessage.tpl (0.01054)
modules/core/templates/ImmediateStatusMessage.tpl (0.00915)
modules/core/templates/ImmediateStatusMessage.tpl (0.00911)
modules/core/templates/ImmediateStatusMessage.tpl (0.00986)
modules/core/templates/ImmediateStatusMessage.tpl (0.01084)
modules/core/templates/ImmediateStatusMessage.tpl (0.00970)
modules/core/templates/ImmediateStatusMessage.tpl (0.01874)
modules/core/templates/ImmediateStatusMessage.tpl (0.01133)
modules/core/templates/ImmediateStatusMessage.tpl (0.01229)
modules/core/templates/ImmediateStatusMessage.tpl (0.01220)
modules/core/templates/ImmediateStatusMessage.tpl (0.01225)
modules/core/templates/ImmediateStatusMessage.tpl (0.01535)
modules/core/templates/ImmediateStatusMessage.tpl (0.01253)
modules/core/templates/ImmediateStatusMessage.tpl (0.01199)
modules/core/templates/ImmediateStatusMessage.tpl (0.00994)
modules/core/templates/ImmediateStatusMessage.tpl (0.01177)
modules/core/templates/ImmediateStatusMessage.tpl (0.01170)
modules/core/templates/ImmediateStatusMessage.tpl (0.01021)
modules/core/templates/ImmediateStatusMessage.tpl (0.00894)
modules/core/templates/ImmediateStatusMessage.tpl (0.00820)
modules/core/templates/ImmediateStatusMessage.tpl (0.00949)
modules/core/templates/ImmediateStatusMessage.tpl (0.01237)
assigned template variables:
{$ImmediateStatus} Array (4)<\/b>
pageTitle<\/b> => Build All Thumbnails/Resizes
sectionTitle<\/b> => Processing...
sectionDescription<\/b> => empty<\/i>
percentComplete<\/b> => 0
{$ImmediateStatusMessage} Array (6)<\/b>
sectionTitle<\/b> => Processing image 180 of 3342
sectionDescription<\/b> => empty<\/i>
memoryUsage<\/b> => 0
memoryLimit<\/b> => 0
percentComplete<\/b> => 0.05
timeRemaining<\/b> => Estimated time remaining: 21:57
{$SCRIPT_NAME} /gallery2/main.php
{$_debug_config_keys} Array (2)<\/b>
0<\/b> => files
1<\/b> => vars
{$_debug_config_vals} Array (2)<\/b>
0<\/b> => Array (0)<\/b>
1<\/b> => Array (0)<\/b>
{$_debug_keys} Array (13)<\/b>
0<\/b> => ImmediateStatus
1<\/b> => ImmediateStatusMessage
2<\/b> => SCRIPT_NAME
3<\/b> => _debug_config_keys
4<\/b> => _debug_config_vals
5<\/b> => _debug_keys
6<\/b> => _debug_tpls
7<\/b> => _debug_vals
8<\/b> => form
9<\/b> => head
10<\/b> => l10Domain
11<\/b> => main
12<\/b> => status
{$_debug_tpls} Array (38)<\/b>
0<\/b> => Array (3)<\/b>
type<\/b> => template
filename<\/b> => templates/global.tpl
depth<\/b> => 0
1<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => gallery:modules/core/templates/Immedi...
depth<\/b> => 1
exec_time<\/b> => 0.0105309486389
2<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => gallery:templates/debug.tpl
depth<\/b> => 1
exec_time<\/b> => 0.025689125061
3<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00888013839722
4<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00870680809021
5<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00871205329895
6<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00863409042358
7<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00866103172302
8<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00887513160706
9<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00867390632629
10<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00875496864319
11<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0142521858215
12<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0214099884033
13<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00952005386353
14<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00929307937622
15<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0106980800629
16<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0109429359436
17<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0105431079865
18<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00915002822876
19<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00910711288452
20<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00986218452454
21<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0108370780945
22<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0096960067749
23<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.018737077713
24<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0113341808319
25<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0122878551483
26<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0122010707855
27<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0122451782227
28<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0153539180756
29<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0125319957733
30<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0119941234589
31<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00994300842285
32<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0117700099945
33<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0116970539093
34<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0102109909058
35<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00893998146057
36<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.00820302963257
37<\/b> => Array (4)<\/b>
type<\/b> => template
filename<\/b> => modules/core/templates/ImmediateStatu...
depth<\/b> => 0
exec_time<\/b> => 0.0094850063324
{$_debug_vals}
Fatal error: Maximum execution time of 30 seconds exceeded in D:\WWW_Root\gallery2\lib\smarty\plugins\modifier.escape.php on line 61

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Fri, 2005-06-10 10:56

Previous msg is debug output from G2. There must be some sort of timer on function in G2 because page was regularly updated with progress report every 5 sec. Apache or PHP would not stop execution in this case.
I have real problem with this because I cannot see any pictures except the ones that are resized. I know that G2 should rebuild thumbnails and resize pictures on demand but it does not happen in my case. I just see descriptions on a first try only after couple of tries I will see some pictures as they are resized.

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Sun, 2005-06-12 07:14

Ok I give up on this, I have a script now that every 5 minutes requests resize all action an I hope eventually all pictures will be fixed

 
Black_MDK

Joined: 2005-06-05
Posts: 19
Posted: Thu, 2005-06-16 19:50

Ok I did not give up. I found the solution.
In the modules\core\classes\Gallery.class on line 570

we have following method

function guaranteeTimeLimit($limit) {
if ($limit <= 0) {
$limit = 30;
}

$now = time();
if (empty($this->_timeLimit) || ($this->_timeLimit - $now < $limit)) {
$this->debug("[$now] can't guarantee $limit -- extending!");

/* Make sure that we extend at least a minimum of 30 seconds */
$this->_timeLimit = $now + max($limit, 30);
set_time_limit($this->_timeLimit - $now);

/*
* Then make sure our locks stick around. Even though this returns
* a status code, we really don't want to make guaranteeTimeLimit()
* return a status code since we want to keep it lightweight. So
* swallow the return code and don't sweat it for now.
*/
if (isset($this->_lockSystem)) {
$this->_lockSystem->refreshLocks($this->_timeLimit);
}
}
}

Now what this does is basically is trying to be smart and overrides settings that you put in php.ini file. Nothing wrong with it except not all of us has same machines and same amount of load on it. In case of Build All Thumbnails/Resizes on windows platform script was setting this timeout to 5 sec and it works in most cases if nothing else is running on machine but when it fails it fails with a bang. This timeout is dynamically set from many places within gallery so there is no way to just go and change it. My solution for now is to implement multiplier, function now looks like this

function guaranteeTimeLimit($limit) {
if ($limit <= 0) {
$limit = 30;
}
$limit = $limit * 2;
$now = time();
if (empty($this->_timeLimit) || ($this->_timeLimit - $now < $limit)) {
$this->debug("[$now] can't guarantee $limit -- extending!");

/* Make sure that we extend at least a minimum of 30 seconds */
$this->_timeLimit = $now + max($limit, 120);
set_time_limit($this->_timeLimit - $now);

/*
* Then make sure our locks stick around. Even though this returns
* a status code, we really don't want to make guaranteeTimeLimit()
* return a status code since we want to keep it lightweight. So
* swallow the return code and don't sweat it for now.
*/
if (isset($this->_lockSystem)) {
$this->_lockSystem->refreshLocks($this->_timeLimit);
}
}
}

Also note I change extension time, which is used primarily for debugging.
I suggest to developers of this wonderful product to implement this multiplayer and have it user settable or something similar to this. After this change my gallery is working perfectly and all thumbnails and pictures are showing and I can upload as many pictures as I wont in one go.

I hope I got explanation right if not somebody can fixit anyway it works for me now.

 
xodeus

Joined: 2003-06-17
Posts: 5
Posted: Mon, 2007-01-01 20:21

That's reallly funny. I can't get the script running. I'm stock at 30 pictures og XXXX.
See the screenshot [img]http://img320.imageshack.us/img320/2174/screenog3.png[/img]
What can I do to get further?

---
Gallery version = 2.1.2 kerne 1.1.0.2
PHP version = 5.2.0 cgi-fcgi
Webserver = Apache
Database = mysql 4.0.24_Debian-10sarge2-log, lock.system=flock
Værktøjer = Exif, Gd
Acceleration = full/900, full/900
Operativsystem = Linux srv1 2.6.12.6-vs2.0 #1