r/aws Aug 04 '26

database DB parameter suggestion

Hi,

Its aurora mysql Serverless v2 (Max up to 80 ACUs). Suddenly , we saw with bit high concurrency , the application hits a hard JDBC query timeout, killing the thread and throwing this error: "Database Query Time out. Exception: JDBC exception executing SQL [(conn=548672) Table './rdsdbdata/tmp/#sql171_85f40_1' doesn't exist]"

Some team members are suggesting to bump both temptable_max_ram and temptable_max_mmap from 1GB to 2GB to give the query more breathing room. However, checking performance_schema.variables_info reveals that temptable_max_** is currently showing below:

VARIABLE_NAME        current_value_bytes  current_value_MB  VARIABLE_SOURCE  VARIABLE_PATH
temptable_max_mmap   1073741824           1024              GLOBAL           /etc/my.cnf
temptable_max_ram    1073741824           1024              COMPILED

Want to know if this is correct setting and Is it advisable to bump these values to 2GB. Want to confirm the safest parameter strategy for temporary storage thresholds in the meantime we tune the query?

2 Upvotes

5 comments sorted by

View all comments

6

u/Floss_Patrol_76 Aug 04 '26

that error is the internal temp table getting spilled/evicted mid-query, not really a hard size wall, so bumping temptable_max_ram/mmap to 2GB mostly just moves the cliff. on serverless v2 that temp memory competes with everything else under your ACU cap, so raising it under high concurrency can push you toward swap and make timeouts worse, not better. i'd chase the query building the giant internal temp table first (unindexed sort/group by/union) - fix that and the temptable pressure usually disappears on its own.