MySQL服务器的thread_stack参数 - 是什么?它应该有多大? [英] MySQL server's thread_stack parameter - what is it? How big should it be?

查看:3715
本文介绍了MySQL服务器的thread_stack参数 - 是什么?它应该有多大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前我从MySQL数据库得到以下错误:

Couple days ago I got following error from MySQL database:


线程堆栈溢出:68744字节用于196608字节堆栈,需要128000个字节。使用'mysqld -O thread_stack =#'指定更大的堆栈。

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.

我发现的所有文档都说: >

All documentation that I found says, that:


MySQL 4.0.10之前的默认值为64KB,此后为192KB。如果线程栈大小太小,它限制了服务器可以处理的SQL语句的复杂性,存储过程的递归深度以及其他内存消耗操作。

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.

我将变量thread_stack设置为256K,但它只是一个随机值。现在它解决了问题,但我真的想知道它应该有多大,得到一些示例值或用法。例如:

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.:


  • 什么可以和什么不能用96KB(x KB)的线程堆栈?

  • 如何计算我需要多大的线程堆栈?

推荐答案

今天遇到了类似的错误。有关变量的 MySQL文档提供了默认值的提示这应该是足够的(对于32位系统为192K,对于64位系统为256K),以及查看 MySQL Benchmark suite

Just ran into a similar error today. The MySQL documentation about 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服务器的thread_stack参数 - 是什么?它应该有多大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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