Some thoughts about mirroring

_guybrush_

Joined: 2005-03-16
Posts: 23
Posted: Thu, 2006-10-05 17:28

I just had a strange problem with my gallery, and spent hours trying to figure out what was happening only to discover that my mirror server was down.

On my main website page, I include the block-random.php page, but suddenly, it stopped working. The page took 1 minute to load, and the random block was empty. On the apache error log, I got a "failed to open stream: HTTP request failed!" entry. Strangely, if I loaded the page block-random.php directly, it displayed fine, but took 1 minute to load. I then checked the gallery. The entry page (albums.php) worked fine. But displaying the content of an album or a single picture also took 1 minute.

Because of the error message got from the inclusion of block-random, I thought the error was coming from a damaged php installation. Clearly, one function wasn't working and timing out. But curiously, after the time out the page was displayed correctly. I was quite puzzled.

It simply turned out my mirror server (which I almost forgot) was down. This is quite annoying. If a mirror server is down, gallery should use the picture from the server from which it is running. First, the timeout to contact the mirror should be lower than 1' and if a timout occurs, Gallery should remember it and not try to access that server during that session. That would greatly improve that functionality.

Besides, the way that gallery systematically uses the mirror to display the pictures is not very efficient. Indeed, depending from where the gallery is accessed, the bandwidth to a server can vary greatly. For exemple my gallery is located on a computer on my LAN. It is also accessible from the outside, but through my ADSL connection (quite low bandwidth). I set up a mirror on my University server. If my gallery is accessed from the outside, image are loaded faster if they are fetched from the mirror. But from inside my lan, loading image from the server would be faster. Unfortunately, Gallery systematically uses the mirror.

In conclusion, It would be great if gallery would use the server which has the fastest connection to the client. Of course this should not be checked for each picture, but once at the beginning of the session.

Gallery version: 1.5.4
Apache version: 2.0.54
PHP version (don't just say PHP 4, please): 5.0.4
Graphics Toolkit: imagemagick
Operating system: XP Home