Ayende @ Rahien

It's a girl

Bug Hunt: What made this blog slow?

A while ago the blog start taking 100% CPU on the client machines. Obviously we were doing something very wrong there, but what exactly was it?

We track down the problem to the following code, can you figure out what the problem?

image

image

Tags:

Posted By: Ayende Rahien

Published at

Originally posted at

Comments

ashic
01/27/2012 10:10 AM by
ashic

ajaxComplete calls fetchResults causes ajaxComplete causes fetchResults....

Josh Reuben
01/27/2012 10:11 AM by
Josh Reuben

IIS applicationPool MaxConcurrentRequestsPerCPU ?

simone
01/27/2012 10:12 AM by
simone

ajaxComplete triggers fetchResults which in turn triggers ajaxComplete

Ryan Heath
01/27/2012 10:14 AM by
Ryan Heath

Each and every ajax call will trigger an ajaxComplete, which will trigger an ajax get, which will trigger an ajaxComplete, which will trigger an ajax get, which etc etc ... ;)

// Ryan

Frank Quednau
01/27/2012 10:42 AM by
Frank Quednau

Kudos ayende for not misusing your position with regard of having the keenest and fastest bug finders.

PS I regularly must reload your captchas because they are hard. I am staring at what seems to be hebrew...

Matt Owen
01/27/2012 01:36 PM by
Matt Owen

I just happened to have Fiddler and this blog open on the day this happened. I saw the madness for myself. Hilarity ensued.

Rob White
01/27/2012 06:56 PM by
Rob White

ajaxComplete -> fetchResults -> ajaxComplete etc.

Even on a Friday, after a drink I spotted that one.

I assume that the real scenario was not as clearly presented.

More hard things please. ;-)

João Bragança
01/27/2012 09:24 PM by
João Bragança

It would have worked if the profiler itself did not return X-RavenDb-Profiling-Id. Unless the profiler markup / js also needs this

Markus
01/27/2012 09:27 PM by
Markus

I'm tempted to say stuff like "idiotic", "stupid" and "wtf?!". But I'm not going to.

Phil
01/30/2012 10:00 AM by
Phil

I assume the fix is :-

if (!id) fetchresults(id.split(', '));

Comments have been closed on this topic.