After upgrading one of my quite popular galleries to the 1.5.12 version the server is going crazy. Downtimes every day, and the traffic is the same or less than before the upgrade.
The only thing I could think about these problems is that CPG 1.5 is giving a lot of url-s for the same content. Before the upgrade, with cpg 1.4.x i used to use this hack (http://forum.coppermine-gallery.net/index.php/topic,49953.0.html), and as I said no server problems before the upgrade. Maybe this makes troubles when a CPG driven gallery has thousands of visitors everyday. Because the visitor gets different urls when visiting the last uploaded files, or last commented files, or filmstrip files ect ect and the server can't handle this very good.
What I need to test with the hope that this will solve my performance problems is to have unique urls sitewide, no matter from where a image is viewed. I know that my gallery will have less functionality after this, but for me is more important to have the site online than a lot of functionalities.
http://www.galsh.com/
Regards.
The hack is similar in cpg1.5.x (but I haven't tested that).
Copy the whole function theme_display_thumbnails from themes/sample/theme.php to your theme's theme.php file, find
} elseif ($aid == 'random') {
$target = "displayimage.php?pid={$thumb['pid']}$uid_link#top_display_media";
} elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
$page = cpg_get_comment_page_number($thumb['msg_id']);
$page = (is_numeric($page)) ? "&page=$page" : '';
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link&msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}";
} else {
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link#top_display_media";
}
and replace with
} else {
$target = "displayimage.php?pid={$thumb['pid']}#top_display_media";
}
For the filmstrip you need to modify the function theme_display_film_strip. Find
} elseif ($aid == 'lastcom' || $aid == 'lastcomby') {
$page = cpg_get_comment_page_number($thumb['msg_id']);
$page = (is_numeric($page)) ? "&page=$page" : '';
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link&msg_id={$thumb['msg_id']}$page#comment{$thumb['msg_id']}";
} else {
$target = "displayimage.php?album=$aid$cat_link$date_link&pid={$thumb['pid']}$uid_link#top_display_media";
}
and replace with
} else {
$target = "displayimage.php?pid={$thumb['pid']}#top_display_media";
}
(or just disable the filmstrip).
Thank you. Great Great Great.
Αndré, with you around Coppermine forums are a better place.
Cheers.
So your problem is solved? If so, please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
Resolve your threads
you can tag your answer as "solved" by clicking on the little image in your initial posting on your thread.
Thank you, this works. We had similar performance issues and this mod decreased server load dramatically.
The same thing here. Since yesterday the server is running smoothly.
I noticed now that the navigation butons, previous, next images, skip to end, are still producing alternative urls. Can you help to fix this too? Thank you.
Copy the whole function theme_html_img_nav_menu from themes/sample/theme.php to your theme's theme.php file, find
$start_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$start]['pid']}";
and replace with
$start_tgt = "$CPG_PHP_SELF?pid={$pic_data[$start]['pid']}";
find
if ($album == 'lastcom' || $album == 'lastcomby') {
$page = cpg_get_comment_page_number($pic_data[$prev]['msg_id']);
$page = (is_numeric($page)) ? "&page=$page" : '';
$prev_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$prev]['pid']}$uid_link&msg_id={$pic_data[$prev]['msg_id']}$page#comment{$pic_data[$prev]['msg_id']}";
$start_tgt .= "$uid_link&msg_id={$pic_data[$start]['msg_id']}$page#comment{$pic_data[$start]['msg_id']}";
} else {
$prev_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$prev]['pid']}$uid_link#top_display_media";
$start_tgt .= "$uid_link#top_display_media";
}
and replace with
$prev_tgt = "$CPG_PHP_SELF?pid={$pic_data[$prev]['pid']}#top_display_media";
$start_tgt .= "#top_display_media";
find
$end_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$end]['pid']}";
and replace with
$end_tgt = "$CPG_PHP_SELF?pid={$pic_data[$end]['pid']}";
find
if ($album == 'lastcom' || $album == 'lastcomby') {
$page = cpg_get_comment_page_number($pic_data[$next]['msg_id']);
$page = (is_numeric($page)) ? "&page=$page" : '';
$next_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$next]['pid']}$uid_link&msg_id={$pic_data[$next]['msg_id']}$page#comment{$pic_data[$next]['msg_id']}";
$end_tgt .= "$uid_link&msg_id={$pic_data[$end]['msg_id']}$page#comment{$pic_data[$end]['msg_id']}";
} else {
$next_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$next]['pid']}$uid_link#top_display_media";
$end_tgt .= "$uid_link#top_display_media";
}
and replace with
$next_tgt = "$CPG_PHP_SELF?pid={$pic_data[$next]['pid']}#top_display_media";
$end_tgt .= "#top_display_media";
Just implemented these changes. Working greatly. Thank you again.