Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Server performance problems after upgrade  (Read 3068 times)

0 Members and 1 Guest are viewing this topic.

profili

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 113
Server performance problems after upgrade
« on: January 20, 2011, 04:01:33 pm »

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, 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Server performance problems after upgrade
« Reply #1 on: January 20, 2011, 05:03:07 pm »

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
Code: [Select]
               } 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
Code: [Select]
               } else {
                    $target = "displayimage.php?pid={$thumb['pid']}#top_display_media";
                }


For the filmstrip you need to modify the function theme_display_film_strip. Find
Code: [Select]
           } 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
Code: [Select]
           } else {
                $target = "displayimage.php?pid={$thumb['pid']}#top_display_media";
            }
(or just disable the filmstrip).
Logged

profili

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 113
Re: Server performance problems after upgrade
« Reply #2 on: January 21, 2011, 01:06:29 am »

Thank you. Great Great Great.
Αndré, with you around Coppermine forums are a better place.

Cheers.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Server performance problems after upgrade
« Reply #3 on: January 21, 2011, 08:57:20 am »

So your problem is solved? If so, please
Resolve your threads
you can tag your answer as "solved" by clicking on the little image in your initial posting on your thread.
Logged

Jokke_K

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Server performance problems after upgrade
« Reply #4 on: January 21, 2011, 08:34:02 pm »

Thank you, this works. We had similar performance issues and this mod decreased server load dramatically.
Logged

profili

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 113
Re: Server performance problems after upgrade
« Reply #5 on: January 22, 2011, 12:29:19 am »

The same thing here. Since yesterday the server is running smoothly.
Logged

profili

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 113
Re: Server performance problems after upgrade
« Reply #6 on: January 25, 2011, 11:36:32 pm »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Server performance problems after upgrade
« Reply #7 on: January 26, 2011, 09:05:21 am »

Copy the whole function theme_html_img_nav_menu from themes/sample/theme.php to your theme's theme.php file, find
Code: [Select]
$start_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$start]['pid']}";and replace with
Code: [Select]
$start_tgt = "$CPG_PHP_SELF?pid={$pic_data[$start]['pid']}";
find
Code: [Select]
        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
Code: [Select]
        $prev_tgt = "$CPG_PHP_SELF?pid={$pic_data[$prev]['pid']}#top_display_media";
        $start_tgt .= "#top_display_media";

find
Code: [Select]
$end_tgt = "$CPG_PHP_SELF?album=$album$cat_link$date_link&pid={$pic_data[$end]['pid']}";and replace with
Code: [Select]
$end_tgt = "$CPG_PHP_SELF?pid={$pic_data[$end]['pid']}";
find
Code: [Select]
        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
Code: [Select]
        $next_tgt = "$CPG_PHP_SELF?pid={$pic_data[$next]['pid']}#top_display_media";
        $end_tgt .= "#top_display_media";
Logged

profili

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 113
Re: Server performance problems after upgrade
« Reply #8 on: January 26, 2011, 12:19:55 pm »

Just implemented these changes. Working greatly. Thank you again.
Logged
Pages: [1]   Go Up
 

Page created in 0.109 seconds with 20 queries.