关于 数据库连接的问题

xjwchy 2011-03-11 03:05:35
数据库连接 占用资源到底有多大呢?
php中的 mysql_connect
如果是这样
连接,关闭 连接,关闭 连接,关闭 连续三次 比一次影响大吗?
...全文
62 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
iihero_ 2011-03-24
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 xjwchy 的回复:]

如果并行的话 这样是不是有问题?
[/Quote]

能少关则少关。
rucypli 2011-03-24
  • 打赏
  • 举报
回复
thread_cache_size

How many threads the server should cache for reuse. When a client disconnects, the client's threads are put in the cache if there are fewer than thread_cache_size threads there. Requests for threads are satisfied by reusing threads taken from the cache if possible, and only when the cache is empty is a new thread created. This variable can be increased to improve performance if you have a lot of new connections. Normally, this does not provide a notable performance improvement if you have a good thread implementation. However, if your server sees hundreds of connections per second you should normally set thread_cache_size high enough so that most new connections use cached threads.
xjwchy 2011-03-24
  • 打赏
  • 举报
回复
如果并行的话 这样是不是有问题?
ACMAIN_CHM 2011-03-11
  • 打赏
  • 举报
回复
楼主所指的“资源”是什么?
楼主的担心主要是什么?

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧