I _Really_ Don't Know

A low-frequency blog by Rob Styles

Throttling Flickr Uploads

I'm part way through uploading a substantial backlog of photos (11,000+) to Flickr.

I had started out trying to go through them and decide which were worth uploading and which weren't, but that approach was taking far too much time. I needed some help. So I decided that I'd upload all of them and open them up to my family to help with the sorting - asking them to tag the photos with the people in them and also use tags like "TODELETE" to mark those that are just noise and should be thrown out.

I could have opened the net wider, but there are photos of my kids and other people's kids in there so just family it is.

I'm using phpFlickr to batch upload photos to Flickr and my script uploads as fast as the bandwidth will allow, though admittedly single-threaded. This meant that I couldn't use it at work, at least not with a clear conscience, so have been uploading from home only. Those 8+ hours a day in the office have been bugging me though, so I was looking for a way to have photos uploading without having a detrimental impact on our connection.

A little googling found an article on bandwidth throttling in OSX that showed the basics of using ipfw to limit transfer rates. A bit of tweaking and I ended up with

sudo ipfw pipe 1 config bw 128KByte/s
sudo ipfw add 1 pipe 1 dst-ip

This limits the upload traffic to api.flickr.com to 128KB/s and means I'm not going to cause anyone a problem.