SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Performance Issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mahajanakhil1985
Yak Posting Veteran

India
71 Posts

Posted - 08/23/2012 :  05:06:44  Show Profile  Reply with Quote
One of our customers uses SQL Server with our application. We have noticed that the user queries become very slow after the SQL Server and application server have run for 10-12 days. I have also turned on SQL rofiler to log SQL statements in a trace file that take more than 10 seconds to execute. When the application runs normally, such queries are only around 3-4 in number. When the slowness occurs, we have many more queries that take more than 10 seconds to execute. Yesterday when the slowness occurred, I noticed that 3 queries of same type took each around 30 minutes to execute. When this happened, it jammed the entire application server and we were left with no other option but restart both SQL Server and application server. After restart when I executed the time consuming SQL in Management Studio, it still took long time to execute. So, I had to cancel its execution as it again jammed the entire application.
As it is production time now, I am yet to run the Database Tuning Advisor on the trace file.

Meanwhile, my questions are:
1. What other areas can I look for?
2. Can one time consuming SQL jam everything else?

mahajanakhil1985
Yak Posting Veteran

India
71 Posts

Posted - 08/23/2012 :  06:59:04  Show Profile  Reply with Quote
I want to add something to the above post. The issue occurs on a VM on ESXi Server. The machine has four CPUs and 12 GB RAM.
Also, the SQL Server holds only one database. The database size is 4-5GBs.
No other resource consuming application runs on this server. The machine is designated to host only application specific database.
Has anybody else ever seen that SQL Server becomes slow after few days of operation on virtual machine?

Edited by - mahajanakhil1985 on 08/23/2012 07:10:33
Go to Top of Page

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1430 Posts

Posted - 08/23/2012 :  16:56:30  Show Profile  Reply with Quote
1) How much new data is being added over time? Are you rebuilding indexes on a regular basis? Do things improcve when you rebuild indexes?
2) Yes, one bad query can have a cascading effect on other queries.

=================================================
We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry

Edited by - Bustaz Kool on 08/23/2012 16:56:51
Go to Top of Page

rx2526
Starting Member

4 Posts

Posted - 08/24/2012 :  00:17:35  Show Profile  Reply with Quote
Have you tried to update stats with sample rate of 30 percent or more ?
EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'
or
EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH SAMPLE 30 PERCENT '
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
1773 Posts

Posted - 08/24/2012 :  03:33:21  Show Profile  Visit jackv's Homepage  Reply with Quote
If the update statistics doesn't solve the issue , next , try a reindex, if that doesn't solve your problem - use Profiler (which a;lready seem to be using) identify the slow running queries - and analyse the execuion plans . For example , can you see anything suspicious like Scans ? Is the code scalable? Once you've exhausted those possibilities, start looking at other factors , such as memory allocation though VM

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

chadmat
The Chadinator

USA
1961 Posts

Posted - 08/24/2012 :  04:03:40  Show Profile  Visit chadmat's Homepage  Reply with Quote
You guys realize Profiler will only exacerbate your problem. You should never run it on a production server. Use a server side trace instead.

-Chad
Go to Top of Page

chadmat
The Chadinator

USA
1961 Posts

Posted - 08/24/2012 :  04:06:24  Show Profile  Visit chadmat's Homepage  Reply with Quote
Have you tried to tune that query? Have you looked at the execution plan? Is it indexed properly?

-Chad
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
1773 Posts

Posted - 08/24/2012 :  12:49:24  Show Profile  Visit jackv's Homepage  Reply with Quote
I'd avoid using the Database Tuning advisor . It can give some good hints , but go through the 3 steps : Statistics, reindex , identify slow queries and tune.

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000