Archive for the ‘Photography’ Category

Photograph of Melanie C in Wikipedia

Tuesday, May 1st, 2007

The other day, I got interesting Flickr mail. It was from a Wikipedia writer, who wanted to use a Flickr image of mine for an article. Whoote! I was pretty excited. One thing I found odd, was that the licensing should only be Creative Commons Attribution-ShareAlike. You can’t have the No Deriviatives clause, neither can you have the No Commercial Use clause (why? Is Wikipedia becoming commercial?). So I went thru a little “re-licensing” process for that particular image.

Anyways, not one of my proudest shooting moments, here’s Melanie C, from the Spice Girls. You’re very nicely attributed and all, so I’m pretty happy with my image being in Wikipedia. Shot at 200mm, f/5.6, with a really beginner lens, aka the 55-200mm (yes, long before the days I had the 70-200/2.8).

Technorati Tags: , , ,

Federation at Flickr: A tour of the Flickr Architecture

Wednesday, April 25th, 2007

I’ve always been a big Flickr fan, and user, and love them even more now that their 2GB limit is gone. So this was a most interesting talk, and I think photographers and Flickr users alike will find it interesting what’s behind Flickr. Dathan also has a very interesting blog.

Federation at Flickr: Doing Billions of Queries Per Day, Dathan Pattishall

Database guy - query, performance, troubleshooting, application building, etc. Previously worked at Friendster in 2003.

Master-Slave lag - unable to keep up with the demand that Flickr was having. So they have multiple masters, the had multiple single points of failure (SPOF).

Everything had to be real time. Write intensive, so more than 1 master needed. No more slave lag. Serve pages fast, with many queries. Get rid of the SPOFs and be redundant.

Need ability to make live maintenance, repair data, and so forth, without taking the site down.

Federation Key Components:

  • Shards: My data gets stored on my shard, but the record of performing action on your comment, is on your shard. When making a comment on someone elses’ blog
  • Global Ring: Its like DNS, you need to know where to go and who controls where you go. Every page view, calculate where your data is, at that moment of time.
  • PHP logic to connect to the shards and keep the data consistent (10 lines of code with comments!)

Shards:

  • Slice of the main database
  • Active Master-Master Ring Replication: a few drawbacks in MySQL 4.1, as honoring commits in Master-Master. AutoIncrement IDs are automated to keep it Active Active.
  • Shard assignments are from a random number for new accounts
  • Migration is done from time to time, so you can remove certain power users. Needs to be balanced if you have a lot of photos… 192,000 photos, 700,000 tags, will take about 3-4 minutes. Migration is done manually.

Global Ring:

  • Its a Lookup Ring for stuff that can’t be federated

Owner_id -> SHARD-ID
Photo_id -> Owner_id
Group_id -> SHARD_ID

It makes sense to hash by user, but then the notion of group. Group can be owned by many users; plus many users are contributing to the group.

This is cached in MEMCache, for about 1/2 hour.

Ticket servers - MySQL 5, low grade machines, circular replication. This is the ID generator. Globally unique ID that is unique. A lot of unique IDs are associated to each row.

Clicking a Favourite:

  • Pulls the Photo owners Account from Cache, to get the shard location (say on shard-5)
  • Pulls my Information from cache, to get my shard location (say on shard-13)
  • Starts a “distributed transaction” - to answer the question: Who favourited the photo? What are my favourites?

Can ask question from any shard, and recover data. Its absolutely redundant.

To get rid of replication lag…

  • every page load, the user is assigned to a bucket
  • if host is down, go to next host in the list; if all hosts are down, display an error page. They don’t use persistant connections, they build connections and tear it down. Every page load thus, tests the connection.

Every users reads and writes are kept in one shard. Notion of replication lag is gone.

Each server in shard is 50% loaded. Shut down 1/2 the servers in each shard. So 1 server in the shard can take the full load if a server of that shard is down or in maintenance mode.

Periods of time when traffic spikes, they break the 50% rule though. They do something like 6,000-7,000 queries per second. Now, its designed for at most 4,000 queries per second to keep it at 50% load.

Average queries per page, are 27-35 SQL statements. Favourites counts are real time. API access to the database is all real time. Achieved the real time requirements without any disadvantages.

Over 36,000 queries per second - running within capacity threshold. Burst of traffic, double 36K/qps. More than 4 billion queries per day.

Each Shard holds 400K+ users data.

“So you’re a single point of failure” — a member of the audience. He’s the main/only DBA at the moment.

Search:

  • Two search back-ends: shards 35k qps on a few shards and Yahoo!’s (proprietary) web search
  • Owner’s single tag search or a batch tag change (say, via Organizr) goes to the Shards due to real-time requirements, everything else goes to Yahoo!’s engine (probably about 90% behind the real-time goodness)
  • Think of it such that you’ve got Lucene-like search

Hardware: EMT64 w/RHEL4, 16GB RAM, 6-disk 15K RPM RAID-10. Data size is at 12 TB of user metadata (these are not photos, this is just innodb ibdata files - the photos are a lot larger). 2U boxes. Each shard has~120GB of data.

“Able to serve the traffic: Priceless”

Things MySQL can do better: Multi-master replication, thread bug in INNODB for 4.1 (its already in 5.0), optimization for OR queries, bitwise, sets.

MySQL 5.0 is used in shards that have aux data, like logging, and also for generating the ticket ID on the ticket servers (no replication between them, single row per server). 64-bit ID, but when exposing to public they use a 32-bit ID to keep the URLs short.

Backup procedure: ibbackup on a cron job, that runs across various shards at different times. Hotbackup to a spare. Snapshots are taken every night across the entire cluster of databases.

Aggregating the data: Very fast, because its a process per shard. Stick it into a table, or recover data from another copy from other users shards.

max_connections = 400 connections per shard, or 800 connections per server & shard. Plenty of capacity and connections. Thread cache is set to 45, because you don’t have more than 45 users having simultaneous activity.

Schema updates? Shut down half the servers, force to other shards, push update, repeat.

32 concurrent InnoDB threads on each shard. 5% of 12TB in memory for pool, so thats about 13GB.

Linux allocates memory per thread, so you can get an OS ERROR saying you’ve run out of memory.

Photos are stored on the filer. Upon upload, it processes the photos, gives you different sizes, then its complete. Metadata and points to the filers, are stored in the database.

Technorati Tags: , , , , , ,

Recent photo uploads

Wednesday, March 28th, 2007

In this month’s PDN, Paul Buckley, vice-president executive art director at Penguin books, states: “When he’s using stock, he tends to go first to Photoeye and Flickr.” I wonder if they uphold the Creative Commons licensing.

I’ve posted some sets and new photos in general:

Technorati Tags: , , , , , ,

Finally, I found out what Photo Booth can be used for

Monday, September 4th, 2006

I always knew that the built-in iSight on the MacBook Pro will come in handy. That, and the fact that Photo Booth is installed probably makes it all the more worthwhile. (i.e. I found out its first use, in a long, long time)

Photo Booth at Sng's 27th Birthday Party
Sue-Anne in sepia

For a party at hand, all I can say is, its fun. Look at what I managed to grab at Sng’s birthday party the other day? Or should I say, what most of the guests managed to grab themselves, and I just happily uploaded…

So there, Photo Booth is a great little application for a party. The iSight works in Linux these days, but we lack a funky time-waster like Photo Booth. And no, I don’t think anyone should bother wasting their efforts on it either - there are more important things to conquer.

Technorati Tags: , ,

sum of life

Monday, July 24th, 2006

play. food. code.
play. food. code.
Maybe it isn’t 42. There’s been an insane number of uploads in the last couple of days to Flickr for me… fast upload speeds help. Boy do I dread going back to 256kbps uploads on Optus.

MySQL Staff Party

Monday, April 24th, 2006

So the last few days have been randomly fun. I’ve been to Fry’s several times to grab random bits and bobs. Things I don’t need, but now have. Hung out with Mikal and Stewart quite a bit, which is always fun. Had lots to drink, and have gotten some work done!

All that aside, today was reserved mostly for our CEO’s house party. It was highly fun, there was drink, great food, and even song!

MySQL Staff Party 2006
Stewart by the bar

There was Foster’s beer! Haha. Go Australian export beer. And Morgan was caught having some. I got to meet so many MySQLers its going to be hard to remember them all. I’m sure by the time the UC is over, all will be well.

MySQL Staff Party 2006
Kaj, my boss. I like this “portrait” of him quite well

Anyways, a picture tells a thousand words, so view the MySQL Staff Party 2006 photoset.

It’s been two weeks

Monday, September 12th, 2005

Caught The Shawshank Redemption. Visited the ACMI for the White Noise digital art exhibition. The Melbourne Flickr group is realistically going to have an exhibition, and I’m taking part in organising. Highly exciting. Clubbed too. Fun last weekend.

Melbourne Spring Fashion Festival 2005 is on all this week. I endeavour to visit it regularly pending free time. It was so exciting I shelled out money for a 1GB Sandisk UltraII CF card too. Conclusion is I need a faster zoom, definitely. Caught The Skeleton Key, on Tuesday, which was interesting - not too scary, and with weird hoodo crap. New Orleans pre-disaster was depicted. For it post-disaster, I suggest Jacob Appelbaum’s weblog.

Spent most of the rest of the week at the Motorola Melbourne Spring Fashion Week. In-between managed to write the Fedora Community Marketing Contacts manifesto. Initial comments seem good, but I clearly want to improve on it this coming week. Last few days saw me getting terribly tired and sick (aching bones, strained muscles) - I think gym visits in the morning at 6.30am and doing all the stuff I do daily (photographing models) is probably not a good idea. Saturday was eat ribs, drink beer, and watch the Gladiator. Oh, and bits to be proud about: Software Freedom Day in Malaysia gave away the IOSN LiveCD running Ubuntu as well as with the premiers and so on. Yum Yum.


You go girl! Close up of a Shag model img_0120 img_0174

Dinner last night was curry fish head with Anne in Box Hill. I highly recommend going to this restaurant (its a Chinese one, serving good Indian curry fish head!). Played with NetNewsWire Lite and realised its really all I need as a Liferea replacement, minus pinning an interesting article (looks like I’ll be needing some Tomboy like application to keep useful blog snippets). Seems all good feedreaders handle OPML quite well (import/export). The weather Dashboard widget needs to be set to “Melbourne, Australia(VIC)” to replace GNOME’s weather report (I still actually like the report that the applet provides, I wonder if there’s a way to con OS X into giving me those details). As for a X-Chat replacement, there’s always Colloquy - its notifications with Growl, and the “person has possibly replied” is a nice feature. I also played with Screen Spanning Doctor on my current iBook, and am pleased to see it works (radeon7500). From the forums, the radeon9550 should also work in the event that I decide to get a 12″ iBook G4. Exporting the Evolution address book is easy - select all, save as vcards, then import into Address Book. Syncs well with my Palm as well. And the talking clock at the top of the hour is just oh so sexy. Need to scroll using Terminal.app + screen + irssi? The magic is in Shift+Fn+PgUp! Another problem solved.

independence

Wednesday, August 31st, 2005

So, err, yeah, apparently trying to get a date for a ball via blog doesn’t work too well. Caught Wedding Crashers - funny as anything, but the ending spoilt it all (or am I just Mr. Cynical?). Selemat Merdeka, all Malaysians, anywhere and everywhere.

Fedora

  • Fedora Marketing Schedule - publically view what we’re up to.
  • meeting minutes - particularly interesting stuff about Community Marketing Contacts, and how we need a Fedora Marketing Kit. This includes slide templates, and what not. My old BrainDump might help.
  • Attending a FESCO meeting today in spite of horrible need to sleep. Joyous topics of getting contributors to not actually sit on the CVS commits list, unless they’re into review, as well as contacting by private email, a committer.
  • FUDCon London 2005 happens on the 6th of October, in the UK. Its a one day event, register for it now! Look at the schedule, and the two keynotes (Michael Tiemann and Alan Cox), already make it worthwhile. I can promise a lot of fun, so go.
  • The 2.6.12-1.1447_FC4 kernel hates me. Well, apparently, not only me. ibm_acpi is borked, so my battery status is gone and I keep on getting errors:
    ACPI-0145: *** Error: Invalid owner_id: 00
    ACPI-0105: *** Error: Could not allocate new owner_id (32 max), AE_OWNER_ID_LIMIT
    ACPI-0509: *** Error: Method execution failed [\_SB_.PCI0.LPC_.EC__.BAT0._BST] (Node c16dcb00), AE_OWNER_ID_LIMIT

So apparently, Monash has a Photography Club in Caulfield, and they’re having an exhibition at the Airport Lounge, at the Clayton Campus. 2nd-17th September are the dates for the exhibition, and the only reason I know about this is because they wanted to use some of my A Walk in Melbourne shots. Oh, and Edition 5 of the MYOSS Mag is out - the horrors of editing!