[Tilesathome] [OSM-dev] Tiles at home - future disk ideas (resend because I missed the list last time)

Robert (Jamie) Munro rjmunro at arjam.net
Mon May 21 11:44:28 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OJW wrote:
> There were many suggestions on wiki for spreading the load across two disks:
> 
> http://wiki.openstreetmap.org/index.php/Tiles%40home/Dev/Website/
> 
> When evaluating those ideas, remember that Stuff takes a long time on dev.  
> Rearranging data takes a long time (133GB of images while the CPU is already 
> in iowait). Rearranging databases takes a long time (27 million rows, while 
> MySQL is already being written-to 300 times per second). Searching for 
> particular types of image, bulk-copying database rows around, even deleting a 
> particular set of images, all take a fair while to complete. 
> 
> My favourite suggestion was the virtual filesystem spanning multiple disks, 
> since it means that tiles can be served using mod-rewrite, and doesn't 
> require adding complexity to the server code.  (schemes with "odd tiles on 
> disk 2" and similar sound interesting, but they need implementing as 
> mod-rewrite rules, which is harder than simply suggesting the strategy)

For even tiles / odd tiles on different discs, all you need is to change
the existing rewrite rules from [0-9]{3} to [0-9]{2}[13579] and
[0-9]{2}[02468]. The full rules needed are below:

RewriteRule ^tile.php/([0-9]+)/([0-9]+)/([0-9]+).png$
00$1/00000$2/00000$3.png
# Catch odd numbers
RewriteRule
^0*([0-9]{2})/0*([0-9]{3})([0-9]{3})/0*([0-9]{3})([0-9]{2}[13579]).png
odddata/Tiles/$1/$2/$3/$4/$5.png
# Catch even numbers
RewriteRule
^0*([0-9]{2})/0*([0-9]{3})([0-9]{3})/0*([0-9]{3})([0-9]{2}[02468]).png
evendata/Tiles/$1/$2/$3/$4/$5.png



I've tried to add the following:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(odddata)/(.*)\.png$ evendata/$2.png

to catch any odd numbered tiles that are stored on "evendata", assuming
that evendata is the current disk, and it's too much work to transfer
the existing odd tiles, but I hit this apache bug:
http://issues.apache.org/bugzilla/show_bug.cgi?id=38642

so that test may not be possible, or it might be fine depending on the
version of Apache, or you might have to do it in the 404 php file or
something.

> So a single filesystem is interesting, but will need a bit of help from 
> filesystem-admin type people.  Has anyone tested performance of such a system 
> compared to regular disks?  What do we do with existing files while the disk 
> is being generated? How easy will it be to add the 3rd and 4th disks?  I'm 
> happy to use such a system if it appears on dev, but implementing it is 
> something for the server admins.

I think it will be far more complicated to set up a virtual filesystem,
unless you are willing to just throw away all the existing data - you
won't be able to just move the existing filesystem to 2 discs, you will
have to create a new filesystem, then copy the existing data. It may be
possible to create the new filesystem on the empty disc, copy all the
data to it, then grow the filesystem back on to the old disc, but this
is a huge operation with the amount of data we are dealing with.

Robert (Jamie) Munro


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUXgJz+aYVHdncI0RAoA9AKCpLZXapJOjC070OgBxL6sQuSDNwwCgr+rA
uN77sfXzt3hdRGrXJzFudLA=
=RFuZ
-----END PGP SIGNATURE-----




More information about the Tilesathome mailing list