官方文档的定义,是指SQL Server 产生的结果集需要经过Network传递到Client,Network不能很快将结果集传输到Client,导致结果集仍然驻留在SQL Server的Session中,可能的原因是SQL Server返回的结果集非常大,或者Network带宽小,传输慢。

ASYNC_NETWORK_IO:Occurs on network writes when the task is blocked behind the network. Verify that the client is processing data from the server.

ASYNC_NETWORK_IO 等待状态出现在SQL Server已经把数据准备好,但是网络发送速度跟不上,导致SQLServer返回的数据集仍然驻留在Session中。
(1)出现这种情况一般不是数据库的问题,调整数据库配置不会有大的帮助。
(2)网络层的瓶颈当然是一个可能的原因:对此要考虑是否真有必要返回那么多数据?
(3)检查应用程序是否有必要向SQL Server申请这么大的结果集。

引用《Wait statistics, or please tell me where it hurts

ASYNC_NETWORK_IO : This is usually where SQL Server is waiting for a client to finish consuming data. It could be that the client has asked for a very large amount of data or just that it’s consuming reeeeeally slowly because of poor programming – I rarely see this being a network issue. Clients often process one row at a time – called RBAR or Row-By-Agonizing-Row – instead of caching the data on the client and acknowledging to SQL Server immediately.

使用Resource Monitor 查看Server的Network Activity

The ASYNC_NETWORK_IO wait indicates that one of two scenarios are happening. The first scenario is that the session (i.e., SPID) is waiting for the client application to process the result set and send a signal back to SQL Server that it is ready to process more data. The second is that there may be a network performance issue.

Reducing SQL Server waits / wait times

If there are significant wait times on ASYNC_NETWORK_IO you have the following options:

  • Review the queries and identify large result sets. Verify that the client application is consuming data as efficiently as possible. For example, if the application is asking for a million rows of data but only processing one row at a time.
  • Review that all rows being requested are necessary. Often times it is the case that you can reduce this wait by filtering the result set for only the rows that are needed. Using the TOP clause may be an option as well. Client applications such as Microsoft Access may benefit from querying a view instead of pulling data from an entire table.

If the above tuning tips are reviewed and applied, but the server is still encountering high wait times, then ensure there aren’t any network-related issues:

  • Validate the network components between the application/clients and the SQL Server instance (router, for example).
  • Look at your NIC configuration on the server to make sure there are no issues with the physical card. Also, check if autodetect is picking the fastest speed.
  • Check network adapter bandwidth: 1 Gigabit is better than 100 megabits, and 100 megabits is better than 10 megabits.

Also worth mention is the common practice of performing data loads on the server. It is possible that you may be seeing the ASYNC_NETWORK_IO wait during the times that the data loads are occurring.If this is the case then make sure the shared memory protocol is enabled for the SQL Server instance and the session is connected using net_transport = ‘Shared memory’.

You can determine the net_transport for the connection by looking at the DMV – sys.dm_exec_connections.

参考文档:

Wait statistics, or please tell me where it hurts

sys.dm_os_wait_stats

WaitType:ASYNC_NETWORK_IO的更多相关文章

  1. WaitType:ASYNC_IO_COMPLETION

    项目组有一个数据库备份的Job运行异常,该Job将备份数据存储到remote server上,平时5个小时就能完成的备份操作,现在运行19个小时还没有完成,backup命令的Wait type是 AS ...

  2. WaitType:CXPACKET

    CXPACKET 等待类型是SQL Server 并发执行一个query时产生的.在run一个big query时,SQL Server充分利用系统的所有资源(CPU,Memory,IO),在最短时间 ...

  3. WaitType:SOS_SCHEDULER_YIELD

    今天遇到一个query,处于SOS_SCHEDULER_YIELD 状态,physical IO 不增加,CPU的使用一直在增长.当一个sql query长时间处于SOS_SCHEDULER_YIEL ...

  4. WaitType:ASYNC

    项目组有一个数据库备份的Job运行异常,该Job将备份数据存储到remote server上,平时5个小时就能完成的备份操作,现在运行19个小时还没有完成,backup命令的Wait type是 AS ...

  5. ASYNC_NETWORK_IO和PREEMPTIVE_OS_WAITFORSINGLEOBJECT等待事件

    背景环境: SQL Server 2005或以上 Select * from 某个表,表的数据量约为30万行,在执行语句时通过观察sys.dm_exec_requests中的wait_type列发现是 ...

  6. SQL Server简洁查询正在运行的进程SQL

    通常我们可以使用 sp_who2 我们希望更加简洁的信息,下面这个查询使用系统表sys.sysprocesses,以及sys.dm_exec_sql_text做OUTER APPLY. T-SQL是这 ...

  7. sys.sysprocesses视图的使用小结

    Sys.SysProcesses 系统表是一个很重要的系统视图,主要用来定位与解决Sql Server的阻塞和死锁包含正在 SQL Server 实例上运行的进程的相关信息.这些进程可以是客户端进程或 ...

  8. SQL Server 性能调优(一)——从等待状态判断系统资源瓶颈【转】

    转载自:http://blog.csdn.net/dba_huangzj/article/details/7607844#comments 通过DMV查看当时SQL SERVER所有任务的状态(sle ...

  9. SQL技术内幕-13 SQL优化方法论之分析实例级别的等待

    优化方法论的第一步是在实例级别上找出什么类型的等待占用了大部分的等待时间,这可以通过查询动态管理图(DMV,dynamic management view)sys.dm_os_wait_stats 运 ...

随机推荐

  1. Python for Infomatics 第14章 数据库和SQL应用三(译)

    14.5 SQL 总结 到目前为止,我们在Python示例程序中使用了SQL,并且涉及了许多SQL基础.在这一小节中,我们特别审视SQL语言,并对其语法进行回顾. 虽然有很多不同的数据库供应商,但因S ...

  2. LINUX下编译安装PHP各种报错大集合

    本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下. nginx1.6.2-mysql5.5.32二进制,php安装报错解决: 123456 [root@clien ...

  3. mysql主从复制配置

    使用mysql主从复制的好处有: 1.采用主从服务器这种架构,稳定性得以提升.如果主服务器发生故障,我们可以使用从服务器来提供服务. 2.在主从服务器上分开处理用户的请求,可以提升数据处理效率. 3. ...

  4. JS中原型链继承

    当我们通过构造函数A来实现一项功能的时候,而构造函数B中需要用到构造函数A中的属性或者方法,如果我们对B中的属性或者方法进行重写就会出现冗杂的代码,同时写出来也很是麻烦.而在js中每个函数都有个原型, ...

  5. 线性分式变换(linear fractional transformation)

    线性分式变换(linear fractional transformation)的名称来源于其定义的形式:(ax+b)/(cx+d),其中分子分母是线性的,然后最外层是一个分式形式,所以叫做这个名字, ...

  6. [ios]利用alertView 插入数据都数据库。笔记

    利用alertView 插入数据都数据库 -(void)addItemToList { UIAlertView *alter=[[UIAlertViewalloc]initWithTitle:@&qu ...

  7. iOS 从某个页面返回然后刷新当前页面

    -------->不说废话 在返回页面实现下面方法: - (void)navigationController:(UINavigationController*)navigationContro ...

  8. ZK 使用jfreeChart

    前台: <?page title="Grid使用" contentType="text/html;charset=UTF-8"?> <zk x ...

  9. mysql 数据表中查找重复记录

    select mobile_phone,count(*) as count from lawyer group by mobile_phone having count>1;

  10. GIT本地免密配置

    在C:\Users\计算机名    下面找到.gitconfig文件(如果没有请新建) 内容为: [user]    name = git用户名[user]    email = 邮箱   [cred ...