Live data from Hacker News

MongoDB's lead developer: Foursquare outage post mortem

groups.google.com

141–150 of 184 posts

Re: MongoDB's lead developer: Foursquare outage post mortem

#141
post #112

so, in short, a company relying entirely on cloud computing machines for storing its data, which is presumably being billed according to the memory usage of those machines, ran out of memory on them, and suffered a large amount of downtime as a result. mongodb had little to do with the problem, other than maybe it took longer than expected to migrate data to a third server. i'm baffled at how there could be no monito…

Exactly. How the hell does a fast growing well funded 24 employee startup NOT have load monitoring on their database servers! Pay the 10c the hour for a micro EC2 instance and run Zabbix or one of the half dozen other awesome monitoring packages out there.

If it's anything like here, any one engineer's task list is essentially a weighted list of fires to put out and technical debt to pay down, in addition to the features to be delivered next day / week.

Guess more extensive monitoring just got bumped to the top :)

Re: MongoDB's lead developer: Foursquare outage post mortem

#142

Earlier quoted context omitted.

Exactly. How the hell does a fast growing well funded 24 employee startup NOT have load monitoring on their database servers! Pay the 10c the hour for a micro EC2 instance and run Zabbix or one of the half dozen other awesome monitoring packages out there.

Other things get prioritized.

Like not having a massive downtime that gives their users a reason to try out some massive social network's offering that has already started eating their lunch? Oh wait no they didn't prioritize that.

My point is, and perhaps the down vote indicates I didn't make it well, that monitoring and alerts are extremely important for any startup. They admit as much in the article, had they known sooner there wouldn't have been any down time. It isn't an excuse to say it got lost in the crush (not that they are trying to use it as an excuse, they're being very upfront and admitting fault).

We have neither the load or the team they do and we have comprehensive monitoring and alerts across our infrastructure as part of the SOE that each server gets. Perhaps we prioritized monitoring higher than them as we are a small team?

And I bet they have prioritized monitoring now. Now where did I put the key to that barn door?

Re: MongoDB's lead developer: Foursquare outage post mortem

#143
post #112

so, in short, a company relying entirely on cloud computing machines for storing its data, which is presumably being billed according to the memory usage of those machines, ran out of memory on them, and suffered a large amount of downtime as a result. mongodb had little to do with the problem, other than maybe it took longer than expected to migrate data to a third server. i'm baffled at how there could be no monito…

> how did the developers come up with 66 gigabytes of ram to use for these instances in the first place? The high-memory quadruple extra large (no, I'm not making that name up) instance offers 68.4GB of ram. Presumably they left the rest for the OS.

HOLY FUCKING SHIT WHAT A CRAZY NAME

Re: MongoDB's lead developer: Foursquare outage post mortem

#144
post #141

Earlier quoted context omitted.

Exactly. How the hell does a fast growing well funded 24 employee startup NOT have load monitoring on their database servers! Pay the 10c the hour for a micro EC2 instance and run Zabbix or one of the half dozen other awesome monitoring packages out there.

If it's anything like here, any one engineer's task list is essentially a weighted list of fires to put out and technical debt to pay down, in addition to the features to be delivered next day / week. Guess more extensive monitoring just got bumped to the top :)

If it is anything like any start up I have ever heard of :P

My point is that it is stupidly important to have good monitoring in place and I am surprised that one of the best known startups had a gaping hole in theirs.

Re: MongoDB's lead developer: Foursquare outage post mortem

#145

Earlier quoted context omitted.

Facebook runs primarily out of ram via memcached. The last numbers I'm aware of were that they had about 200TB in memcache capacity [1]. They use a variety of data stores, but primarily sharded mysql. I don't have recent numbers there, but they were above 1000 master-master pairs as of 2008. While buying that much ram sound costly, that's only looking at capacity. Assuming typical 1u servers and common pricing at the…

Anything that is both latency sensitive (web apps are) and requires high throughput is going to be RAM-centric. Even services operating at much smaller scales with "old school" single DB boxes need to keep the vast majority of active data in RAM and use things like battery-backed write caches to get acceptable write throughput. Even with the sophisticated tricks mature RDBMS software uses to squeeze every ounce of pe…

I have had very acceptable performance for latency critical applications where the db have exceeded the available memory by a factor between 10 and 50.

So far I have never heard of any one running a commercial RDBMS reiterate the MySQL-mantra that you need the entire DB in RAM and I find it a very puzzling attitude to efficient database usage.

Re: MongoDB's lead developer: Foursquare outage post mortem

#146
post #70

Earlier quoted context omitted.

Nagios is pretty nice. It's dead easy to write custom monitors and clients are everywhere, there's even a Firefox extension. It requires a bit of learning to get going with but it's not so bad and the pay-off is big. That said I'm looking at monit too. I hear it's quite nice and has less of a learning curve.

I'll put a vote in for Zabbix as a good option, it has saved us more times than I can count.

zabbix user here, and it works nicely. But man, it is painful to use.

Re: MongoDB's lead developer: Foursquare outage post mortem

#147

Building sharded systems isn't as simple as throwing consistent hashing into the code and calling it a day. You have to think carefully about what happens when nodes exceed capacity. There is good work in academia on distribution algorithms that gracefully handle reaching capacity (along with data center structure such as rack awareness) [1]. Alternately, if your algorithm doesn't handle a shard reaching capacity you…

I'm wondering if the decision to shard based on users was taken with data (ie, at that point did each user have a roughly similar number of check-ins); if not, hashing by that seems kind of fail for that kind of app.

[deleted]

Re: MongoDB's lead developer: Foursquare outage post mortem

#148
post #4

For example, if we had notifications in place to alert us 12 hours earlier that we needed more capacity, we could have added a third shard, migrated data, and then compacted the slaves. Where did Foursquare find their engineers? I hope no one lost their job here but this is pretty elementary stuff.

Disclaimer: I work at Cloudkick. We can help you all with these problems. Here's how fast/easy it is: 1. Create an account (~30 sec) 2. Add your cloud credentials (~45 sec) 3. Install the monitoring agent (~90 sec/node) 4. Create a CPU/Memory/Disk monitor, query-targeted all your servers (~60 sec) (example: "provider:EC2") 5. You get an email whenever the monitors you created reach the thresholds you set There are a…

Or you could install Ganglia for free.

Re: MongoDB's lead developer: Foursquare outage post mortem

#149
post #90

Earlier quoted context omitted.

From the email thread, it sounds like the decision to shard on UID was made mostly to increase locality of data, so that you didn't have to query more than one node to get a single user's data. There's no silver bullet here. Hashing on insertion order would basically guarantee that writes would favor one node over another, which random hashes would force you to aggregate results from all available nodes for each quer…

This stuff can be very counter intuitive. Locality may not be what you want. For example, last I heard google's search index was sharded by document rather than by term. That sounds odd, since if it was sharded by term, then a given search would only need to go to a handful of servers (one for each term) and then the intermediate result combined. But with it sharded by document, every query has to go to all the nodes…

That sounds odd, since if it was sharded by term, then a given search would only need to go to a handful of servers (one for each term) and then the intermediate result combined. But with it sharded by document, every query has to go to all the nodes in each replica/cluster.

Exactly. Then a flash crowd occurs and your shard fails to service requests.

Re: MongoDB's lead developer: Foursquare outage post mortem

#150

Earlier quoted context omitted.

I work on a team of 2 where I'm responsible for a handful of servers. I chimed in because I'm in a similar position, I've been looking for a monitoring solution for a while now. Things like nagios and zenoss are over kill, but lack of time has prevented me from finding an ideal solution. That said, I keep htop open and running at all times, and its saved my ass on more than one occasion. I say htop because of the col…

Nagios/Cacti/etc. are indeed overkill for a few servers, but Munin is dead-simple and has notifications: http://munin-monitoring.org/wiki/HowToContact

Second vote for Munin, is simple, quick to install and set up and covers all the basics.
Post reply on HN