High CPU, database can not read and write the real murderer

Source: Internet
Author: User

Interested students can refer to the following series of articles, are for dump analysis of the actual combat and summary:

Windbg Dump Analysis (original summary)

Http://www.cnblogs.com/LoveOfPrince/p/6653341.html

Remember a memory leak dump analysis

Http://www.cnblogs.com/LoveOfPrince/p/6032523.html

-------------------------------------------------back to the Chase-------------------------------------------------------------------- --

Some days ago a service, the online CPU often soared to very high, and other services intermittently unable to read and write the database.

The siege lions were checked for a few days and there was no obvious discovery.

Later, they threw a dump to me, preliminary analysis only the service uses the company's built-in warehouse based on EF, the problem should be here.

In the absence of the code permissions for the warehouse, and more things on hand, let them check the storage.

The next day handy to the warehouse code, and grabbed a few dump, the basic finalized, the details are as follows:

1. The managed thread stack mostly stays below and takes a lot of time.

databaselogformatter.executing000000000e6bbfb8 0000000077c2bd7a [HELPERMETHODFRAME:000000000E6BBFB8] 000000000e6bc100 000007fe99238fc0 system.data.entity.infrastructure.interception.databaselogformatter.executing[ [System.__canon, mscorlib]] (System.Data.Common.DbCommand, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext '  1<System.__Canon>) 000000000e6bc160 000007fe99238ec6 System.Data.Entity.Infrastructure.Interception.DatabaseLogFormatter.ReaderExecuting ( System.Data.Common.DbCommand

2. Further analysis, there are too many objects to be recycled in the second generation .

Heap0Generation0Has *finalizable Objects (000000000f312ec0->000000000f312fd8) Generation1Has4finalizable Objects (000000000f312ea0->000000000f312ec0) Generation2Has48152finalizable Objects (000000000f2b4de0->000000000f312ea0) Ready forFinalization0Objects (000000000f312fd8->000000000f312fd8)------------------------------Heap1Generation0Has Afinalizable Objects (000000001165a780->000000001165a7e0) Generation1Has3finalizable Objects (000000001165a768->000000001165a780) Generation2Has49727finalizable Objects (00000000115f9570->000000001165a768) Ready forFinalization0Objects (000000001165a7e0->000000001165a7e0)------------------------------Heap2Generation0Has +finalizable Objects (00000000115a4c30->00000000115A4CC8) Generation1Has9finalizable Objects (00000000115a4be8->00000000115a4c30) Generation2Has42725finalizable Objects (00000000115514c0->00000000115a4be8) Ready forFinalization0Objects (00000000115a4cc8->00000000115A4CC8)------------------------------Heap3Generation0Has -finalizable Objects (000000000f36a9b8->000000000f36aa48) Generation1Has -finalizable Objects (000000000f36a948->000000000f36a9b8) Generation2Has44483finalizable Objects (000000000f313b30->000000000f36a948) Ready forFinalization0Objects (000000000f36aa48->000000000f36aa48)

And these objects are mostly EF-related.

MT Count totalsize Class name000007fef694bb403162       227664System.Reflection.Emit.DynamicResolver000007fef68e76d036109       866616System.weakreference000007fe987e9f4035941      4887976System.Data.Entity.Core.EntityClient.EntityConnection000007fe987d75f037157      5053352MySql.Data.MySqlClient.MySqlConnection000007fe987e7d5835952      6615168System.Data.Entity.Core.Objects.ObjectContext000007fe9881469035952      8053248System.Data.Entity.Internal.LazyInternalContext

3. As seen above, the doubt is still in the storage of this piece.

To track the stack, to see mysqlconnection, considerthe X dbcontext:idisposable destruction method is not enough direct and thorough.

The connections read here are not destroyed, which confirms the inference, and lets them check if the service is using the storage properly.

Is there a sense of accomplishment ... Should I go to find a sister, to end the single is the right thing ah??

High CPU, database can not read and write the real murderer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.