I've been working here and there on new way to display the pictures on the website that I've collected up over the years. For the past while I've had them just all put in a big directory and ran album
against the directory. This has worked fine for a long time, but due to the recent increase in traffic to the pictures I needed to do something to tone thing down a bit. Just last month I used 40 gigs of traffic on the picture area of the website alone.
So I've created a set of python scripts to create thumbnails and update a database that holds all the picture information. Through a couple of rather simple php files I can then display the pages in a fashion that is very similar to the album output. Each image load is then tracked in a database so I can tell how much bandwidth usage is being consumed by each host, and then if necessary limit load times or whatever need be to slow down requests.
This also allows me to keep some more neat statistics like how many times an image has been viewed and so on. One day I might even get around to putting most viewed/last viewed pages up, and also allow users to trim down results based on image size or resolution and such. It'll also be interesting to see how the server handles the increase in load with the extra amount of database activity of the new pages...
posted at: 23:58 | path: /general | permanent link to this entry