just get a high CPU case, Here is the way I narrow down the issues.
Problems: IIS get high CPU, even only small requests been forwarded to this server.
Answer: something wrong with the json.net, need to update the dll to latest version. http://json.codeplex.com/releases/view/50552
receipt to locate the problem.
Create a Memory Dump using the DebugDiag. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en
Also copy 3 dlls from production server to debug machine. follow
windbg:PDB symbol for mscorwks.dll not loaded when you debug dump of .net app or silverlight apps and How to configure WinDbg to run other versions of the .NET
to make sure the windbg pick up the right extensions.
What are those CPU threads doing? pick up the smoking gun threads
How about CPU threads , time spending.
the top 15 threads using a lot CPU cycles. What are they doing Now.
|Switch the first thread, #32 |
thread 32 is not a managed thread. but that doesn’t exclude our CLR code from the bad lists.
then run kb
thread 32 is working on GC, which is CPU intensive.
then try other top cpu intensive threads they did the same thingg, Working on GC
search gc context, there is a lot
|x mscorwks!SVR::gc_heap::* |
So all those busy threads is working on GC, which thread triggered the Demand for GC? that will be the next question.
time to check out those green threads. which consumes rest quota of the CPU
65:1f74 0 days 0:14:17.843
|Switch to thread 65 or 44 |
the stack means in the shopping cart page, it will use json.net to parse some value. in our case, the values is stord in Cookie.
Is this tread is asking for more memory. It is, Let me show you why?
1, it try to create a big array, then NO space. ask for runtime to issue a gc.
then for us, we get very big value to parse. there are some thing wrong with the cookie system. Update to the new version will get better performance
anyway, for Json Deserialization. first make sure the size is reasonable before you parse it.