如何在Mysql中删除sleep进程 [英] How to delete sleep process in Mysql

查看:586
本文介绍了如何在Mysql中删除sleep进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现我的mysql服务器有很多连接是睡觉的。我想删除它们所有。

I found that my mysql sever have many of connection who is sleep. i want to delete them all.

所以我可以配置我的mysql服务器,然后删除或处置正在睡眠的连接当前正在进行中。

so how i can configure my mysql server than then delete or dispose the connection who is in sleep not currently in process.

这可能删除这个东西在mysql告诉我如何可以做以下

are this possible to delete this thing in mysql tell me how i can do following

一个连接只允许一次datareader打开

a connection allow only one time datareader open and destroy the connection [process] after giving resposnse of query.

推荐答案

为什么要删除一个睡眠的线程? MySQL为连接请求创建线程,并且当客户端断开连接时,线程被放回缓存并等待另一个连接。

Why would you want to delete a sleeping thread? MySQL creates threads for connection requests, and when the client disconnects the thread is put back into the cache and waits for another connection.

这减少了创建线程的开销按需,这是没有什么可担心的。睡眠线程使用大约256k的内存。

This reduces a lot of overhead of creating threads 'on-demand', and it's nothing to worry about. A sleeping thread uses about 256k of memory.

这篇关于如何在Mysql中删除sleep进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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