4 ms·
Remember the old "thundering herd" problem with Apache children and things of that nature? You'd basically have a whole bunch of processes which had a listenin
by rachelbythebay 14y ago
Remember the old "thundering herd" problem with Apache children and things of that nature? You'd basically have a whole bunch of processes which had a listening fd from an earlier call to listen(). When a new connection would come in, the kernel would wake all of them, even though only one of them would actually have something to get. The others would go through the process for nothing. It caused a big performance hit back in the day.
Well, imagine now that you have a directory or lock service where you can store things and perform atomic updates. When you do a write to something in it, it fans out to all of its clients, and they all wake up (nearly) simultaneously and receive the update. They then have to do whatever processing you do with new data of that type.
If they all do this at the same time, then you have no processes left to service incoming requests. They're all identically busy with whatever mutexes held in order to apply those config changes safely, so no other work happens on those clients while they load in the new data.
It's not so much that it's taking a mutex and is getting stuck for a little bit, since that's going to happen no matter what. It's that all of the children do it at the same time, so there's nobody to service your hit, and you're guaranteed to get stuck. If it was spread out, then only some percentage of incoming requests would get stuck behind this. The others would get lucky and would hit another instance which either had already run it or hadn't yet run it.
I'm not saying this is what's going on here, but it sure sounds familiar.
- stingraycharles 14y agoOn what basis do you think these issues are related? The bug report provides very little insight in what's going on, only that there's a severe performance degradation at 9AM. The thundering herd problem applied to waking up child processes is one possible explanation, but there are dozens of other explanations that are just as likely, based on the information we're provided with.
- brown9-2 14y agoThe commenter you are replying to is a former Google employee; the description of the lock service sounds like Chubby (http://research.google.com/archive/chubby.html http://research.google.com/archive/chubby.html), App Engine likely uses some sort of distributed directory service for keeping track of things like quotas.
- rachelbythebay 14y ago9 AM in Brussels is midnight here on the west coast if I've done my time zone math properly. It's the perfect time to push something. Unfortunately, if that means having everything snap-to and then freeze for a couple of seconds, that's not good. Again, I don't know if this is what happened here. I've just seen this sort of thing before.