简体   繁体   English

MySQL客户端/服务器:带有ACK标志但没有PSH的TCP响应数据包

[英]MySQL client/server: TCP response packet with ACK flag but without PSH

I have this Linux binary application which establishes 2 persistent connections to the local MySQL server (using 127.0.0.1 as hostname). 我有这个Linux二进制应用程序,它与本地MySQL服务器建立2个持久连接(使用127.0.0.1作为主机名)。

Every 15 minutes such application has to perform 2000 single-row insert s (please don't question database design), but what happens is that at a certain point connection B "hangs" for nearly 20 seconds right after sending the n-th insert statement to MySQL; 这样的应用程序每15分钟必须执行2000次单行insert (请不要质疑数据库设计),但是发生的情况是,在发送第n个insert后,连接B在某个点“挂起”了将近20秒对MySQL的声明; looking at a tcp dump with wireshark it turns out that in such context MySQL responds with a simple ACK packet, without any MySQL protocol specific section, but indeed without the PSH flag, so it is not recognized as a proper MySQL "response OK" message. 看着wireshark的tcp转储,事实证明,在这种情况下,MySQL以简单的ACK数据包响应,没有任何MySQL协议特定部分,但实际上没有PSH标志,因此它不被识别为正确的MySQL“响应OK”消息。

Could anyone please indicate the reason why MySQL server responds to a request query packet with a simple ACK TCP packet without the PSH flag? 谁能说明为什么MySQL服务器使用不带PSH标志的简单ACK TCP数据包响应请求查询数据包的原因?

TCP ack's are at the TCP level, not the application(mysql protocol) level. TCP ack位于TCP级别,而不是应用程序(mysql协议)级别。

The TCP stack ACK's the data you sent. TCP堆栈ACK是您发送的数据。 This means it has successfully received the data, and possbily handed the data off to the user (the mysql server in your case). 这意味着它已经成功接收了数据,并有可能将数据交给了用户(在您的情况下是mysql服务器)。

So the MySQL server is busy executing your query, and it will return an application response (the MySQL "response OK" message you're looking for) when it is done executing the query (which in your cases for some reason or another takes 20 seconds) - perhaps there is I/O contention, perhaps some other long running query holds a lock, or some other heavy work needs to be done as a result of your queries. 因此,MySQL服务器正在忙于执行查询,并且在执行完查询后将返回应用程序响应(您要查找的MySQL“响应OK”消息)(在您的情况下,由于某种原因或其他原因,它需要20秒)-可能存在I / O争用,也许其他长时间运行的查询持有锁定,或者由于查询而需要完成其他繁重的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android客户端/ Java服务器和Mysql数据库Tcp套接字编程 - Android Client /Java Server and Mysql DataBase Tcp Socket Programming MySQL协议客户端/服务器认证-来自客户端的认证数据包的令牌生成 - MySQL Protocol Client/Server Authenication - Token Generation for Authenication Packet from Client 有谁知道为什么MySql Client和MySql Server具有不同的默认max_allowed_pa​​cket值? - Anyone know why the MySql Client and MySql Server have different Default max_allowed_packet values? 不使用tcp连接到Mysql - Connecting to Mysql without using tcp perl tcp套接服务器到mysql - perl tcp socket server to mysql MySql在Ubuntu Server的读取授权包上崩溃 - MySql crashing on Ubuntu Server 'reading authorization packet' "Mysql-Client Jumphost 从本地客户端到 Web 服务器到没有 DB 服务器 SSH 用户的 DB 服务器" - Mysql-Client Jumphost from Local Client to Webserver to DB Server without DB Server SSH User 我们可以在没有服务器和客户端的情况下添加MySQL索引吗? - Can we add MySQL Indexes without the server and client? 解决ERROR 2006 (HY000): MySQL server has away without change the max_allowed_pa​​cket - Solve the ERROR 2006 (HY000): MySQL server has gone away without change the max_allowed_packet MySQL:在运行时为客户端确定max_allowed_pa​​cket的值 - MySQL: determine the value of max_allowed_packet for the client at runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM