Skip to content

Commit bca1619

Browse files
committed
Moved tmp_table_size to per connection
Changed variable titles
1 parent f4355a1 commit bca1619

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/components/MemoryCalculator.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,35 +166,36 @@ const MemoryCalculator: React.FC<Props> = ({ darkMode }) => {
166166
<h3 className={`text-lg font-semibold mb-4 ${darkMode ? 'text-gray-300' : 'text-gray-700'}`}>
167167
Global Buffers
168168
</h3>
169-
{renderInput('innodb_buffer_pool_size', 'InnoDB Buffer Pool Size',
169+
{renderInput('innodb_buffer_pool_size', 'innodb_buffer_pool_size',
170170
'Memory used to cache table and index data')}
171-
{renderInput('innodb_log_buffer_size', 'InnoDB Log Buffer Size',
171+
{renderInput('innodb_log_buffer_size', 'innodb_log_buffer_size',
172172
'Memory used for transaction log operations')}
173-
{renderInput('key_buffer_size', 'Key Buffer Size',
173+
{renderInput('key_buffer_size', 'key_buffer_size',
174174
'Buffer for MyISAM table indexes')}
175-
{renderInput('query_cache_size', 'Query Cache Size',
175+
{renderInput('query_cache_size', 'query_cache_size',
176176
'Memory allocated for caching query results')}
177-
{renderInput('tmp_table_size', 'Temporary Table Size',
178-
'Maximum size for in-memory temporary tables')}
179177
</div>
180178

181-
{renderInput('max_connections', 'Max Connections',
179+
180+
{renderInput('max_connections', 'max_connections',
182181
'Maximum number of simultaneous client connections', false)}
183182

184183
<div>
185184
<h3 className={`text-lg font-semibold mb-4 ${darkMode ? 'text-gray-300' : 'text-gray-700'}`}>
186185
Per-Connection Settings
187186
</h3>
188-
{renderInput('sort_buffer_size', 'Sort Buffer Size',
187+
{renderInput('sort_buffer_size', 'sort_buffer_size',
189188
'Memory allocated for sorting operations per connection')}
190-
{renderInput('read_buffer_size', 'Read Buffer Size',
189+
{renderInput('read_buffer_size', 'read_buffer_size',
191190
'Buffer used for sequential table scans')}
192-
{renderInput('read_rnd_buffer_size', 'Random Read Buffer Size',
191+
{renderInput('read_rnd_buffer_size', 'read_rnd_buffer_size',
193192
'Buffer for reading rows in sorted order')}
194-
{renderInput('join_buffer_size', 'Join Buffer Size',
193+
{renderInput('join_buffer_size', 'join_buffer_size',
195194
'Buffer used for joins without indexes')}
196-
{renderInput('thread_stack', 'Thread Stack',
195+
{renderInput('thread_stack', 'thread_stack',
197196
'Stack size for each connection thread')}
197+
{renderInput('tmp_table_size', 'tmp_table_size',
198+
'Maximum size for in-memory temporary tables')}
198199
</div>
199200
</div>
200201
</div>

src/utils/calculations.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ export const calculateTotalMemory = (variables: any) => {
3131
variables.innodb_buffer_pool_size +
3232
variables.innodb_log_buffer_size +
3333
variables.key_buffer_size +
34-
variables.query_cache_size +
35-
variables.tmp_table_size;
34+
variables.query_cache_size;
3635

3736
const perConnectionBuffers =
3837
variables.sort_buffer_size +
3938
variables.read_buffer_size +
4039
variables.read_rnd_buffer_size +
4140
variables.join_buffer_size +
42-
variables.thread_stack;
41+
variables.thread_stack +
42+
variables.tmp_table_size;
4343

4444
const totalPerConnection = perConnectionBuffers * variables.max_connections;
4545
const total = globalBuffers + totalPerConnection;

0 commit comments

Comments
 (0)