打开连接的开销 [英] Overhead of opening connection

查看:79
本文介绍了打开连接的开销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用C#OPEN语句打开与数据库的连接时,这是否会影响Web服务器的性能或仅影响数据库?
因此,反复打开和关闭数据库连接会如何影响Web服务器和数据库.
有人可以请我对此提供一些见解.谢谢.

When a connection to DB is opened using C# OPEN statement, does that impact the web server performance or only the Database?
So, how does the repeated opening and closing of the database connection impact the web server and the database.
Can somebody please give me some insight on this. Thanks.

推荐答案

数据库和Web服务器是两个完全独立的实体.连接到一个对另一个没有直接影响.

如果两者都托管在同一台计算机上,则可能导致间接影响.然后很可能一个人忙于处理请求,以至于耗尽计算机的物理资源(处理器,内存等),并拒绝其他进程访问它们.

独立地,SQL Server具有连接池 [
Databases and Web Servers are two completely separate entities. Connecting to one has no direct effect on the other.

Indirect effects could be caused if both are hosted on the same computer. Then it''s possible that one could be so busy handling requests that it could exhaust the computers physical resources (processor, memory, etc) and deny the other processes access to them.

Independently, SQL Server has connection pooling[^] to maximize the performance of clients that are rapidly connecting and disconnecting.


这篇关于打开连接的开销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆