MySQL 服务器的 thread_stack 参数 - 它是什么?应该有多大?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2919558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL server's thread_stack parameter - what is it? How big should it be?
提问by ssobczak
Couple days ago I got following error from MySQL database:
几天前,我从 MySQL 数据库中收到以下错误:
Thread stack overrun: 68744 bytes used of a 196608 byte stack, and 128000 bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack.
线程堆栈溢出:196608 字节堆栈中使用了 68744 字节,需要 128000 字节。使用 'mysqld -O thread_stack=#' 指定更大的堆栈。
All documentation that I found says, that:
我找到的所有文件都说:
The default is 64KB before MySQL 4.0.10 and 192KB thereafter. If the thread stack size is too small, it limits the complexity of the SQL statements that the server can handle, the recursion depth of stored procedures, and other memory-consuming actions.
MySQL 4.0.10 之前的默认值为 64KB,之后为 192KB。如果线程堆栈大小太小,则会限制服务器可以处理的 SQL 语句的复杂性、存储过程的递归深度以及其他消耗内存的操作。
I set the variable thread_stack to 256K, but it was just a random value. For now it solved the problem, but i'd really like to know how big should it be, get some example values, or usages. E.g.:
我将变量 thread_stack 设置为 256K,但它只是一个随机值。现在它解决了这个问题,但我真的很想知道它应该有多大,获取一些示例值或用法。例如:
- What can and what can't i do with 96KB (x KB) of thread stack?
- How to compute how big thread stack do i need?
- 96KB (x KB) 的线程堆栈可以做什么,不能做什么?
- 如何计算我需要多大的线程堆栈?
回答by drvdijk
Just ran into a similar error today. The MySQL documentationabout the variable provides a hint for default values which should be enough (192K for 32 bit systems and 256K for 64 bit systems), as well as to look at the MySQL Benchmark suite.
今天刚遇到类似的错误。关于该变量的MySQL 文档提供了一个提示,默认值应该足够了(32 位系统为 192K,64 位系统为 256K),以及查看MySQL 基准套件。