coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: GGallery on June 08, 2004, 08:21:34 AM

Title: CPG on heavy traffic site => lastup misses pics
Post by: GGallery on June 08, 2004, 08:21:34 AM
Hi,

we just launched CPG on http://gallery.greatestjournal.com today and it rocks! (3k pics within a couple of hours)

The only major problem I found so far is that every couple of seconds a pic is getting uploaded - if then somebody clicks on one of the lastups on the frontpage he might (very, very often) actually get a pic or 2 pics newer than the selected one (because of pos=...) - Does anybody have a fix for that?

Also I am curious if anybody scaled CPG to a couple million pics and what to expect / how to tune, etc.

Also, are there any mobile blogging solutions already? (cellphone2coppermine)
Title: Re: CPG on heavy traffic site => lastup misses pics
Post by: Joachim Müller on June 08, 2004, 08:37:51 AM
Only one question per thread please...GauGau
Title: Re: CPG on heavy traffic site => lastup misses pics
Post by: GGallery on June 08, 2004, 06:52:15 PM
hmmm sorry for asking for so many questions at once - I didn't want to spam the board... guess I'll have to build a modified lastup with a latest_uploads tables which gets purged every 10 minutes so it can scale, I'll submit that here once finalized.

As far as I can see the design itself should be able to scale very nicely(?) - one of the first things to do will be to put all the original pics on a cheap IDE raid1 on a different server mounted per nfs and have only the normal_ and thumb_ pics on SCSI/in cached RAM on the webserver... that should take me beyond 1M+
Title: Re: CPG on heavy traffic site => lastup misses pics
Post by: Casper on June 08, 2004, 09:25:56 PM
If you have users adding pics every few seconds, then the last uploads page will be out of date within seconds of opening it, and if you click one of the pics shown after another pic has been added, it will go to the wrong pic.

This is expected, as the link from the thumbnail is not to the individual pic, but to '/displayimage.php?album=lastup&cat=&pos=0' etc.  This url will point to a different pic every time someone adds a pic.
Title: Re: CPG on heavy traffic site => lastup misses pics
Post by: GGallery on June 09, 2004, 07:17:25 AM
yes, I figured that out... I am wondering how to 'fix' that since it makes CM a little bit less useful for bigger galleries (which would be a shame as I compared many and I think CM is the best)
I guess something like this could work:

add an additional "image_id" to the url, e.g.: &pos=n&image_id=xxxx

- once user clicks on a pic: check that pos in fact translates to image_id - if not then 'look' +- 20 postions "left and right" in the selected album and adjust position if neccessary.
Title: Re: CPG on heavy traffic site => lastup misses pics
Post by: Tarique Sani on June 09, 2004, 07:34:24 AM
The simple fix is to pass the pid along with the URL and display picture based on this pid. Since the last upload position is not going to be valid anyways it will not tbe the same subsets which display in the filmstrip everytime, may be filmstrip can be disabled for all meta albums as in theory all these albums will change too fast for positions to be valid
Title: Re: CPG on heavy traffic site => lastup misses pics
Post by: GGallery on June 10, 2004, 01:31:04 AM
OK, but how to I hack that into the code?

I am right now in function theme_display_thumbnails( in themes/max_ox_x/theme.php and it says on line 1320:
  '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}",

I tried a   '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}&pid={$thumb['pid']}",M
but there is no "pid" in thumb... somebody can enlighten me?
Title: Re: CPG on heavy traffic site => lastup misses pics
Post by: GGallery on June 10, 2004, 01:34:32 AM
actually coming from index.php/lastup the url should look like this:
http://gallery.greatestjournal.com/displayimage.php?pos=-8761

then the user always always sees the correct "lastup" and other images from this user which is really cool... (but I still don;t know how to put the pid in there)

(the whole concept with the relative 'pos=' is IMHO not a good idea... people just copy and paste what's in the browser's addressbar into emails and forums and all in a sudden people get completely different pics)