![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
For some reason, our DBA has the value of thread_stack set for the minimum allowed for this version of MySQL which is running on our school's Linux Debian server (131,072 instead of the default 192KB). |
|
The procedures I plan to implement would need a recursion depth of about 40, max. 50. |
|
Is there any way of calculating in advance what the minimum value of thread_stack should be? |
|
And are there any negative side effects to setting this variable to, say, 256KB instead of the default 192KB? |
#3
| ||||
| ||||
|
|
Robert Hairgrove<nobody (AT) hogwash (DOT) com> wrote: For some reason, our DBA has the value of thread_stack set for the minimum allowed for this version of MySQL which is running on our school's Linux Debian server (131,072 instead of the default 192KB). This is a bad idea already. Under unlucky circumstances this can lead to a MySQL crash due to stack overflow. |
|
The procedures I plan to implement would need a recursion depth of about 40, max. 50. Why? Can't you rewrite the code to *not* use recursion? Recursive code often looks more elegant, but is quite as often less efficient than a nonrecursive solution. |

|
Is there any way of calculating in advance what the minimum value of thread_stack should be? No. But you can try. Just write a recursive procedure and try up to which recursion depth it works (prepare to be killed by the DBA) |
If my code works on my|
And are there any negative side effects to setting this variable to, say, 256KB instead of the default 192KB? On 32-bit systems this will result in fewer possible max_connections because there will be more address space allocated. Note that this is *not* running out of memory, but running out of address space. On 64-bit systems this is a non-issue. The lazy memory allocation strategy of almost all operating systems will "conceal" the extra stack space allocation when it is not used. |
![]() |
| Thread Tools | |
| Display Modes | |
| |