Hey all,
I was digging through the forum and didn't find related issues.
I'm running about 70k+ images and 1732 albums. Everything works great once all the images cache. Pages loads less than 5 seconds. I wanted to add latest updated albums to index page using the code below but it triggered two issues
<?php printLatestUpdatedAlbums(4, false, false, false, false,false,230,false,false); ?>
one, page load increase from < 5 seconds to 12 seconds ~ higher
two, zenphoto generated mysql error.
Zenphoto error
MySQL Query (Select id, title, folder, thumb FROM 'flava_albums' WHERE 'show'=1) failed.
Error:MySQL server has gone away. it looks like your zenphoto tables haven't been created. you may need to run the setup script.
i ran the setup again but the remedy still exist.
below is the installation information from zen overview page
Zenphoto version 1.2.6 [4335] (Official Build)
Current gallery theme: flavalocal
PHP version: 5.2.6
Graphics support: PHP GD library bundled (2.0.34 compatible)
PHP memory limit: 1024M (Note: Your server might allocate less!)
MySQL version: 5.0.67
Database name: flava
Table prefix: flava_
Spam filter: simple
Captcha generator: zenphoto
What did i miss?
Comments
`
printLatestUpdatedAlbums(4, false, false, false, false,false,230,false,false) (yours)
printLatestUpdatedAlbums(5, false, false, false, 40,'',230,230,false) (correct)
`
The "40" does nothing if you set the description display to false also the 230 for height.
1732 albums does not sound like a lot, maybe the server you are running MySQL on is not adequate for your gallery.
so below is the final parameters
printLatestUpdatedAlbums(4, false, false, false, false,'',230,230,false);
Currently, I'm using default theme and testing it locally. Index page contains 8 parents categories (each of these categories don't use random album cover, this help load time a bit) Below is the printLatestUpdatedAlbums(), that's it.
like i said above without using printLatestUpdatedAlbums(); the page load faster.
@sbillard - I'm aware that there's nothing wrong with query. I saw some people running more albums on production and it's stable. By the way, Can you elaborate a little bit, which settings do i need to change? should i bump up php memory limit? should i create a different server just to host mysql?
The page will of course load faster without the printLatestUPdatedAlbums() because there is a bit of processing that function needs to do. However, I did take a look at the code and did some optimizations. You could try tonight's nightly build and see if it helps. But the actual query of the error stays as it is necessary.
Earlier, I found a solution to improve loading time by using http compression and expires header.
I added this code to .htaccess
Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2014 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>
AddOutputFilterByType DEFLATE text/html text/plain text/xml
<FilesMatch "\.(php|html|js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
YSlow score 71 or equal to C (originally the score was 52 or equal to E, lol)
Loading time went down from ~15 seconds to 7 - 9 seconds
i can tell the difference that the page load faster compare to before but there's a problem. Right now is rendering the parent category instead of rendering latest/newest albums. Should i printLatestAlbums instead of printLatestUpdatedAlbums?
- printLatestAlbums refers to the latest created/uploaded albums
- printLatestUpdatedAlbums refers to those albums that have got new images or subalbums. These could of course be quite old albums.
Current stable version display printLatestUpdatedAlbums the same like printLatestAlbums.
It's a bit confusing.
By the way, the page is loading faster now. I didn't realize there's an html cache plugin. lol. It speeds up the loading like crazy. Thank you for this plugin.
printLatestAlbums render the latest albums from each of parents categories and printLatestUpdatedAlbums render the parent of each updated subalbums.