Home Database Mysql Tutorial 有关SQL server connection Keep Alive的几个问题解答

有关SQL server connection Keep Alive的几个问题解答

Jun 07, 2016 pm 05:54 PM
sql server question

1 、什么是SQL server TCP 连接的keep Alive ? 简单说,keep alive 是SQL server在建立每一个TCP 连接的时候,指定了TCP 协议的keepaliveinterval 和keepalivetime参数。这样对每个TCP连接,如果该连接空闲时间(没有任何数据交互)超过keepalivetime,TCP

1、什么是SQL server TCP连接的keep Alive

简单说,keep alive 是SQL server在建立每一个TCP 连接的时候,指定了TCP 协议的keepaliveinterval 和keepalivetime参数。这样对每个TCP连接,如果该连接空闲时间(没有任何数据交互)超过keepalivetime,TCP协议会自动发出keepalive 包检测连接存活与否。如果keepalive 检测次数超过注册表TcpMaxDataRetransmissions定义的值而对方还是没有回应,那么TCP就认为该连接有问题而关闭它。通过这样的机制SQL server能够检测出orphaned connection等问题。

SQL  server 对每个TCP连接缺省指定keep alive 为30秒,keepaliveinterval为1秒。Windows TCP配置的TcpMaxDataRetransmissions缺省是5次。就是说,如果TCP连接idle了30秒,那么TCP会发送第一个keepalive检查。如果失败,那么TCP会每隔1秒重发keepalive 包,直到重发5次。如果第五次检测依然失败,则该连接就被close。所以,一个TCP连接如果出现异常问题,大概在35秒的时候就会被close。

2、在那里可以配置SQL server 的keep alive 配置?

SQL server 2000代码里面也有对TCP连接指定keep alive属性,但没有提供用户界面给用户定制修改。SQL server2005使用configuration manager可以修改keep alive值,但是不能修改keepalive interval。 Keepaliveinterval是hardcoded的1秒。

Configuration manager的界面如下:

 

该值保存在注册表如下位置:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.?\MSSQLServer\SuperSocketNetLib\Tcp

注意SQL server的Native client也有类似配置,不要和server side 的TCP配置搞混了:

 

Native client的 keep alive 配置保存在如下位置:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SNI9.0\tcp

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solve the 'error: redefinition of class 'ClassName'' problem that appears in C++ code Solve the 'error: redefinition of class 'ClassName'' problem that appears in C++ code Aug 25, 2023 pm 06:01 PM

Solve the "error:redefinitionofclass'ClassName'" problem in C++ code. In C++ programming, we often encounter various compilation errors. One of the common errors is "error:redefinitionofclass 'ClassName'" (redefinition error of class 'ClassName'). This error usually occurs when the same class is defined multiple times. This article will

How to solve the problem that jQuery cannot obtain the form element value How to solve the problem that jQuery cannot obtain the form element value Feb 19, 2024 pm 02:01 PM

To solve the problem that jQuery.val() cannot be used, specific code examples are required. For front-end developers, using jQuery is one of the common operations. Among them, using the .val() method to get or set the value of a form element is a very common operation. However, in some specific cases, the problem of not being able to use the .val() method may arise. This article will introduce some common situations and solutions, and provide specific code examples. Problem Description When using jQuery to develop front-end pages, sometimes you will encounter

Teach you how to diagnose common iPhone problems Teach you how to diagnose common iPhone problems Dec 03, 2023 am 08:15 AM

Known for its powerful performance and versatile features, the iPhone is not immune to the occasional hiccup or technical difficulty, a common trait among complex electronic devices. Experiencing iPhone problems can be frustrating, but usually no alarm is needed. In this comprehensive guide, we aim to demystify some of the most commonly encountered challenges associated with iPhone usage. Our step-by-step approach is designed to help you resolve these common issues, providing practical solutions and troubleshooting tips to get your equipment back in peak working order. Whether you're facing a glitch or a more complex problem, this article can help you resolve them effectively. General Troubleshooting Tips Before delving into specific troubleshooting steps, here are some helpful

Clustering effect evaluation problem in clustering algorithm Clustering effect evaluation problem in clustering algorithm Oct 10, 2023 pm 01:12 PM

The clustering effect evaluation problem in the clustering algorithm requires specific code examples. Clustering is an unsupervised learning method that groups similar samples into one category by clustering data. In clustering algorithms, how to evaluate the effect of clustering is an important issue. This article will introduce several commonly used clustering effect evaluation indicators and give corresponding code examples. 1. Clustering effect evaluation index Silhouette Coefficient Silhouette coefficient evaluates the clustering effect by calculating the closeness of the sample and the degree of separation from other clusters.

The problem of generalization ability of machine learning models The problem of generalization ability of machine learning models Oct 08, 2023 am 10:46 AM

The generalization ability of machine learning models requires specific code examples. With the development and application of machine learning becoming more and more widespread, people are paying more and more attention to the generalization ability of machine learning models. Generalization ability refers to the prediction ability of a machine learning model on unlabeled data, and can also be understood as the adaptability of the model in the real world. A good machine learning model should have high generalization ability and be able to make accurate predictions on new data. However, in practical applications, we often encounter models that perform well on the training set, but fail on the test set or real

Reward design issues in reinforcement learning Reward design issues in reinforcement learning Oct 08, 2023 pm 01:09 PM

The problem of reward design in reinforcement learning requires specific code examples. Reinforcement learning is a machine learning method whose goal is to learn how to take actions that maximize cumulative rewards through interaction with the environment. In reinforcement learning, reward plays a crucial role. It is a signal in the learning process of the agent and is used to guide its behavior. However, reward design is a challenging problem, and reasonable reward design can greatly affect the performance of reinforcement learning algorithms. In reinforcement learning, rewards can be thought of as the agent versus the environment

Label acquisition problem in weakly supervised learning Label acquisition problem in weakly supervised learning Oct 08, 2023 am 09:18 AM

The label acquisition problem in weakly supervised learning requires specific code examples. Introduction: Weakly supervised learning is a machine learning method that uses weak labels for training. Different from traditional supervised learning, weakly supervised learning only needs to use fewer labels to train the model, rather than each sample needs to have an accurate label. However, in weakly supervised learning, how to accurately obtain useful information from weak labels is a key issue. This article will introduce the label acquisition problem in weakly supervised learning and give specific code examples. Introduction to the label acquisition problem in weakly supervised learning:

Is your Wi-Fi not working on macOS Sonoma? Here's what you can do Is your Wi-Fi not working on macOS Sonoma? Here's what you can do Oct 03, 2023 pm 03:41 PM

Wi-Fi has become an integral part of our daily lives, from checking into a hotel to working in a new office or visiting friends. It is the bridge that connects our devices to the digital world. This can be a big inconvenience when Wi-Fi on macOS Sonoma starts working. If your Wi-Fi isn't working properly on macOS Sonoma as well, don't worry, there are things you can do. Why doesn't Wi-Fi work on macOS Sonoma? The first step in resolving the Wi-Fi not fixing macOS Sonoma issue is to determine the scope and impact of the problem. Does it affect a specific application, your Mac, or all connected devices? Is your Wi-Fi slow or completely non-existent?

See all articles