如何设置MySQL进程或线程的最大数量? [英] How can I set the max number of MySQL processes or threads?

查看:1080
本文介绍了如何设置MySQL进程或线程的最大数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ps axuw| grep mysql仅表示MySQL进程,但是如果我运行htop,我可以看到10行,每行都有一个单独的PID.所以我想知道它们是线程还是进程,由于某种原因我看不到使用ps.

ps axuw| grep mysql indicates only MySQL process, but if I run htop I can see 10 rows each one of them with a separate PID. So I wonder if they are threads or processes that for some reason I cannot see using ps.

在我的开发机器上尝试将它们限制为两个是没有任何意义的,因为我不需要很多客户端的并发访问.

Would it make any sense to try to limit them to two on my development machine, where I don't need concurrent access of many clients.

在Ubuntu 8.10上运行的BTW

BTW Running on Ubuntu 8.10

推荐答案

您可以这样设置my.ini中的最大线程数:

You can set the max number of threads in your my.ini like this:

max_connections=2

不过,您可能还需要设置以下内容:

However you might also want to set this:

thread_cache_size=1

即使没有任何反应,线程缓存也可以控制打开多少缓存.

The thread cache controls how many it keeps open even when nothing is happening.

这篇关于如何设置MySQL进程或线程的最大数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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