gpt4 book ai didi

database - 同一台 Linux 机器上的两个应用程序之间的 tcp 连接是否会断开

转载 作者:太空宇宙 更新时间:2023-11-04 04:16:59 25 4
gpt4 key购买 nike

我正在使用连接池连接到同一台 Linux 计算机上的数据库。我想绝对确定从连接池获得的连接是有效的。我现在正在测试借用连接,但理论上 tcp 连接仍然可以在验证和实际请求之间断开连接。此外,在每个请求之前进行测试会损害延迟和吞吐量。

使用文件套接字怎么样?它会断开连接吗?

更新:我想知道连接是否会在网络层中断。难道只有app或者DB才能主动结束连接吗?

最佳答案

I am now testing the connection on borrowing but theoretically the tcp connection can still disconnect between the validation and the actual request.

确实但不太可能。

Additionally, testing before each request hurts latency and throughput.

(1) 仅当您为每个请求借用新连接时。 (2) 你衡量过“伤害”吗?

How about using a file socket? Will it ever disconnect?

你当然不能假设它不会。例如,数据库端可能会在空闲时关闭它。

关于database - 同一台 Linux 机器上的两个应用程序之间的 tcp 连接是否会断开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15922793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com