Is it safe to keep database connections open for long time?

本文探讨了在非7*24运行需求场景下,数据库连接保持长时间打开的必要性及性能影响。建议非持续运行应用关闭连接以提升整体性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

see http://stackoverflow.com/questions/312702/is-it-safe-to-keep-database-connections-open-for-long-time

其中的一个回复很有启发。如果不是这个功能要求7*24在运行的话,就没有必要保持长时间的数据库连接了。

If you are talking about a client/server application, I would recommend closing each connection as soon as you are done using it. While each individual application instance might take a small performance hit opening the connection, your application as a whole will scale better. 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值