Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
652 views
in Technique[技术] by (71.8m points)

configuration - MySQL server's thread_stack parameter - what is it? How big should it be?

Couple days ago I got following error from MySQL database:

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:

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.

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

  • 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?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...