Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

20 second delay on initial access but then it's fast
https://www.tinywebgallery.com/forum/viewtopic.php?f=4&t=1762
Page 1 of 1

Author:  rp4000 [ 17. Dec 2008, 02:20 ]
Post subject:  20 second delay on initial access but then it's fast

Initial access to the first page of the gallery takes about 20 seconds. Is there a setting that would speed this up?

Here's my current configuration.

$show_counter_in_jstree=false;
$show_number_of_pic=false;
$use_random_image_for_folder=false;
$use_image_magic=true;
$exclude_directories=array(".cache","multiple","multiples","webmagickicons","tools","_notes");
$cache_gen_wait_time=0;
$max_gen_num=100000;
$show_captions=true;
$remove_1_day_data=false;
$print_watermark = false;
$remove_1_day_data=false;
$cache_time=-1;

Author:  TinyWebGallery [ 17. Dec 2008, 02:48 ]
Post subject: 

how many images do you have in your gallery?

btw. you are in the wrong part of the forum.

- Michael

Author:  rp4000 [ 17. Dec 2008, 02:54 ]
Post subject: 

Oops sorry.

About 73K. The top level is about 8 folders. There are no images at the second level - just folders there as well.

Author:  TinyWebGallery [ 17. Dec 2008, 11:03 ]
Post subject: 

Seems you already have set most of the caching stuff.

$cache_dirs = true;

I think as well. If the album explorer shown by default or is it hidden?

But if all the caches are build then the loading should be much faster.

When you close the browser and access the gallery again you have to wait 20s again?

- Michael

Author:  rp4000 [ 17. Dec 2008, 14:21 ]
Post subject: 

I'll try cache_dirs=true. When I close the browse and reopen it takes just a few seconds. The explorer is hidden but is there on the left hand side for me to click on - so I assume it has built the directory structure?

Author:  TinyWebGallery [ 17. Dec 2008, 14:38 ]
Post subject: 

if it's not visible right away I try to build it in the background because this tree takes quite some time.
This tree has unfortunately a different issue. How many directories do you have? I have found out the the Javascript is executed very slow if this tree is huge. This is a browser problem.

You can switch the album explorer off and see if there is a difference.

if cache_dirs=true was not set before then the whole caching was disabled. Means all the settings you have done where useless ;).

- Michael

Author:  rp4000 [ 19. Dec 2008, 14:06 ]
Post subject: 

Thanks. I missed $cache_dirs completely! I also found I need to increase $maximum_transations_per_session to match the number of images.

(I'm not sure you have maximum_transations_per_session documented in the configuration section btw)

Author:  TinyWebGallery [ 21. Dec 2008, 20:49 ]
Post subject: 

No I didn't. I always though that 10 000 per session is enough. You are really sure that this is needed?

I implemented that to prevent that boos scan the whole gallery and produce a lot of traffic.

- Michael

Author:  rp4000 [ 21. Dec 2008, 23:17 ]
Post subject: 

Pretty sure. I noticed (ls -ltr | wc -l) that the cache was only getting generated 10K files at a time. If I stayed in the browser it did not generate more than 10K even if I repeatedly regenerated the cache. I noticed it because the image/second rate appeared too fast.

Ultimately I also got a message about too many transactions (10K exceeded) which, since I didn't write down and thought initially was a php/apache limit, took a little while to track down.

I increased to 100K and a "generate cache" worked fine.

Where I suspect a delay right now is creating _count_tree_all.tmp.php.

(Michael, I'm quite happy to track this down further myself as I have time)

Author:  TinyWebGallery [ 22. Dec 2008, 00:52 ]
Post subject: 

you are right. This values are connected.

I will change in the next version that this counter is reseted when the generation is done. Then they work independently of each other.

- Michael

Author:  websailor [ 5. Jan 2009, 02:56 ]
Post subject: 

rp4000 and Michael,

Just wanted to say thank you for this info - I was looking for a way to change the cache generation wait time and there it was! Now I can generate a full cache much faster than before for my ~50,000 images.

TWG has fantastic support from Michael.

:D

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/