Monday, 15 April 2013

sql - Database Server 100%, for no reason -


We have a Windows Server 2003 (x64) running as a database server. The database is equipped with 32 GB RAM

Usually, database memory usage is between 5-10%. Although sometimes the database shoots up to 100% and remains there, without any random changes and without any change in code or execution.

All types of research, payment or by me, a stored procedure when the database is 100%, by disabling this process, the database will return to normal.

Now it is quite clear but it is a strange part.

The stored procedure is optimized and memory usage (from the execution plan) is 0.01, which is exceptionally good. I will also get immediate results as a result of the execution of stored procedures. I also provided a Rackspace Fanatic Support DBA to monitor it, and said that he does not see any problem in the stored procedure.

Now the extra weird bit.

  • Running SP is an instantaneous.
  • When DB is 100%, SP is executed on minutes for minutes while running SP.
  • By disabling SP, 5-10% to DB
  • Although SP is capable, DB is 100%, if I open a new query window and run exact code from SP, but not as a question, as a result of SP, results It is immediately returned

Therefore, although at first glance, it seems that the SP needs to be optimized, the actual code in SP is not a problem.

I'm desperate!

The execution plan can change depending on the input parameter for SP and size.

You can try to add stored code to WITH RECOMPILE to get a fresh execution plan for each code. It will slow down, but sometimes SQL Server is stuck with unusually poor execution plans for most queries and recompile help in those scenarios.


No comments:

Post a Comment