Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2018 January SQL Server: Frequently Restart a SQL Server is a bad practice

SQL Server: Frequently Restart a SQL Server is a bad practice

SQL Dont Do It

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

Yesterday, I was solving a performance issue of a client, and I found that their in-house DBAs scheduled to restart a SQL Server at every Sunday.

I simply stopped my all tuning work and immediately set a meeting with DBA team.
To restart a SQL Server, again and again, is a very bad practice and it leads to the biggest performance issue.

You must be aware of the following points, before restarting a SQL Server.

A Plan Cache of SQL Server stores the precompiled execution plan for frequently executed of queries.
It improves the query performance by reducing a cost of creating and compiling execution plan again and again.

Apparently, most of our queries are frequently executing.

Once you restart the SQL Server, it clears the Plan Cache area, and all your queries require to create a new query plan which degrades the performance.

A Buffer Pool of SQL Server, very capable of storing the result of your frequently executed queries.

It reduces the disk/io and improves the query performance by sending a result directly from the memory area.
If a result is not available in the buffer pool, it fetches from the disk.

When you restart the SQL Server, it clears the Buffer Pool area, and it takes more time to fill it again.

The Dynamic Management Views and Functions of SQL Server, return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance.

The DMVs and DMFs are the first tool for SQL DBA to monitor the health of SQL Server. The DMVs and DMFs store its data into the process space of sqlservr.exe.

Once you restart your SQL Server, it clears all DMVs and DMFs statistics by destroying the process of sqlservr.exe.

The rollback of uncommitted transactions of SQL Server, this is a part of SQL Server crash recovery which rollback all uncommitted transactions.

Now imagine that you are going to restart your SQL Server and few of queries are still running.

In this situation, SQL Server rollbacks all uncommitted transactions which degrade the performance and restart process might take more time to complete the action.

Jan 14, 2018Anvesh Patel
SQL Server 2016: Introduced Live Query Statistics, Monitor Live Query ExecutionSQL Server 2014: Buffer Pool Extension to improve I/O throughput and Query Cache
Comments: 5
  1. Barak
    January 22, 2018 at 1:45 pm

    Had tremendous performance issue, that were solved always after restarting SQL Server.
    Main app is a vendor app that keeps alive the connection to SQL Server.
    It took me a lot of time to understand that tempdb is growing to the point where temp tables wait for others to drop because nothing get realease until the user is shutting down his PC – and no one does.
    I have incorporated kill to all user sessions on the DB at 3am everyday.
    If you need to release activity – that is a better alternative than restarting SQL Server.

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      January 22, 2018 at 8:10 pm

      Nice addition Barak, thank you…

      ReplyCancel
  2. Narsingpatel
    January 25, 2018 at 3:53 pm

    It is not about addiction Anvesh, as a database engineer what other activities you suggest?
    Defrag
    Create missing index, drop unused index
    Capture running queries and tune them
    Anything else?

    ReplyCancel
    • Anvesh Patel
      Anvesh Patel
      January 25, 2018 at 6:10 pm

      Ya not an addiction, but there are many things that you can make a vide list.
      Sharing main categories
      1. Server/Configuration level (file physical locations, buffer management, memory management, cache management, in-memory objects and more…)
      2. Database level (starting with defining object names, indexes, fragmentation, heap, partitioning, columnar configuration, multithreading processing and many more…)
      3. Hardware level (disk type, network type, server-client locations, ip-address, SSL connections, MSDTC, data pipelines and many more…)

      ReplyCancel
  3. rob hutchison
    November 19, 2018 at 6:38 pm

    Hi,

    Most people don’t think of this but the system parameters @@cpu_busy, @@io_busy and @@idle overflow after about 49 days. If you depend on any of them for determining how busy your SQL Server has been you should reboot monthly. They only get reset with you reboot or restart SQL Server services.

    It would be nice if there was some way of manually resetting them. Please let me know if you or anyone has found a way to reset them.

    Rob

    ReplyCancel

Leave a Reply to Anvesh Patel Cancel reply

CAPTCHA
Refresh

*

Anvesh Patel
Anvesh Patel

Database Engineer

ImageJanuary 14, 2018 5 Comments SQL ServerAnvesh Patel, database, database research and development, dbrnd, performance, Restart SQL Server, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....