Bug Hunt: What made this blog slow? previous: Northwind Starter Kit Review: Conclusion next: 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? Comments 01/27/2012 10:08 AM by Sandrino Di Mattia An infinite loop caused by ajaxComplete? 01/27/2012 10:10 AM by ashic ajaxComplete calls fetchResults causes ajaxComplete causes fetchResults.... 01/27/2012 10:11 AM by Josh Reuben IIS applicationPool MaxConcurrentRequestsPerCPU ? 01/27/2012 10:12 AM by simone ajaxComplete triggers fetchResults which in turn triggers ajaxComplete 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 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... 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. 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. ;-) 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 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. 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.