Sunday, January 13, 2008

Growth, performance and madness

Phew! been a busy time in code land for me. Mostly Entrecard. We've got a lot to do, things have picked up hugely and lots of people are having a good time which is great, but we've got a long way to go to where we want to be.

Various fascinating reads on the site and forum recently, obviously we had the interview with Graham on problogger where we got a ton of positive comments from new and old alike (yes, I really do read pretty much everything anyone says if I can find it, although that became a lot harder since google started returning 178,000+ results for "entrecard").

We had an interesting scrap about the economy that ran for a bit. I don't really agree with anything Slam has to say on the subject of credit value but then I'm biased ;).

People have talked about buying and selling of credits as if it were some black and white thing where either credits are entirely trapped within the system or credits are rushing out the door like free icecream, but when it comes down to it there are a wide variety of alternatives. The majority of the major credit-based economies out there complete almost all of their transactions in-house, only a relatively small percentage of credits bought or sold are traded for regular currency despite the relative freedom to do so. Even if Entrecard was a totally open market with "BUY CREDITS NOW" on the homepage, I'm willing to bet we wouldn't generate more than 5% of the total credits per day in currency conversion, and we're not going to do anything like that.

Remember, we hit half a million drops the other day, that's a million credits into the econ in a little over two months, that's 17k/day even if you're going by the averages rather than the numbers we do per day now. Any alternate methods of credit creation are highly unlikely to make any real dent in that number.

I'd tell you the exact numbers but our admin economy page is currently out of order, it can't handle the volume of data anymore. Recently we've been pretty much doubling the number of visits every 10 days, a level of growth that poses problems no matter how good your planning is.

It's fascinating in a sense, our architecture is designed to scale up to a million blogs in theory, but as you bring more and more users on board you hit milestones where certain parts of the system just hit rough edges you didn't see coming. We've run load testing on entrecard.com that says it should be able to push over 50 dynamic page views per second on our current platform, and yet it started struggling recently well short of that.

The reason is pretty simple. Load testing systems are not real users. You can construct load testing setups that do a much better job of simulating them than the one I used, but even then people simply do unexpected things. In addition, the planned patterns of use often turn out to be bogus. In the case of Entrecard it was almost a product of a change in our focus as we got more familiar with the product. Initially it was thought that users would turn up to the main site only to fiddle with their control panel, there was nothing else really planned, we had the categories page and that was about it (those who can remember it at release are laughing).

As a consequence I was heavily focused on making sure we could deliver enough widgets - the amazon S3 system we use for example - rather than making the "control panel" website quick.

Then came chain dropping, the category tabs, the forum, the shop, the blog, the message system...and suddenly Entrecard.com itself became a primary destination, and our visits-per-user shot up...and thus our load testing profile was suddenly worthless.

So this week I got a bit sidetracked, delayed a few new things for a couple of days and started doing some proper profiling and taking some serious performance action. Much of it won't be visible until the next code drop but we did do some rearchitecting of the hosting systems tonight, I'm going to be interested to see the results in the morning.

For those wondering what kind of effort it takes to host Entrecard, consider this, we have to serve a widget for every page view that every one of over 2,500 blogs get. Some of those blogs are pretty damn popular all by themselves - and more sign up every day.

It's a challenge, and I love it. Just occasionally I wonder why I'm not working at a standard corporate fast asleep at my desk tho ;)

Labels: , ,

Friday, January 4, 2008

Solving hijackings

Credit to Ender:

"Alternatively, the airlines place a bomb on every plane. In the event of a hijacking, the pilot will detonate the bomb, and the airline will claim responsibility. Thus denying any would-be terrorists both the plane and the claim that _they_ blew it up."

Genius!

Labels:

Crazy week or so

I tell you what, I felt like an anxious parent when I went off on holiday. Entrecard has been going solid for 2 months now, and normally by that point I have all the bugs sorted and everything is nice and stable in an app.

However Entrecard has been different from many of my projects for a number of reasons, not the least of which has been the sheer pace of change. Nearly every bug fix goes hand in hand with some new feature or cleanup, and we have a user community who are constantly pushing the limits of what they can do.

Needless to say, all of this combined to mean that I was going on holiday wondering whether anything would be standing when I got back.

Ok, not really. I have a Nokia e61 which lets me check in on things and do emergency work if needed, plus we have monitoring etc so I wasn't blind, but going away from my desktop was still a little bit harder than usual.

Started "working" again when I got back on New years day, although I doubt anybody noticed I was gone since I still found myself reading the forums and posting etc - only thing that was different was that the response time for bug fixes took a dive until I got back.

Kicked out the new shiny release today. Along with the usual stack of bug fixes, including one infuriating messagebox issue to do with the content renderer, we have a bunch of new stuff in the shop in preparation for all the contest people getting their seller tokens. The browse interface is still ugly as hell but I'll get on that asap once we've got a few more entries in and I can get an idea of what people are putting up. The shop item stuff is pretty cool - along with the usual stuff you can create "keyed" items that exist for a limited number of uses or times. These items can then be queried via a couple of methods to see whether the user has an active one.

You can use this to create, for example, a "pass" which lets people into an area of your site (requires a little bit of coding on your part), so people can simply buy a pass on Entrecard, then go to your site and view your "backstage" section (or whatever) all automatically.

This is all a bit experimental at the moment but we should have it bedded down over the next couple of days. Fun times.

Labels: