- JavaScript 83.1%
- HTML 16.9%
|
|
||
|---|---|---|
| .github | ||
| assets | ||
| .gitignore | ||
| index.html | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| POSTGRESQL_IMPLEMENTATION_PLAN.md | ||
| readme.md | ||
MySQL/MariaDB Settings Calculator
Description
The MySQL/MariaDB Settings Calculator is a web-based tool designed to help database administrators and developers optimize their MySQL or MariaDB database settings based on their server's available memory. This calculator provides recommendations for key configuration parameters, ensuring better performance and resource utilization.
Features
- Interactive memory allocation input using sliders and text fields
- Real-time calculation of recommended MySQL/MariaDB settings
- Comprehensive set of recommendations, including:
- InnoDB buffer pool size
- Max connections
- Key buffer size
- Query cache size
- Tmp table size
- InnoDB log file size and buffer size
- Various InnoDB-specific settings
- Sort, read, and join buffer sizes
- Links to official MySQL documentation for each setting
- Responsive design for both desktop and mobile devices
- FAQ section addressing common questions about database settings
- Useful links to MySQL and MariaDB tutorials and documentation
Usage
- Open the calculator in your web browser.
- Use the sliders or input fields to specify:
- Total Server Memory (GB)
- Reserved Memory for OS (GB)
- Memory for Other Tasks (GB)
- The recommended settings will update automatically as you adjust the inputs.
- Review the recommended settings in the results table.
- Click on any setting name to view its official MySQL documentation for more information.
- Consult the FAQ section for answers to common questions about database settings.
- Use the provided links to access additional MySQL and MariaDB resources.
Calculation Methods
The calculator uses the following methods to determine the recommended settings:
-
Available Memory:
Available Memory = Total Server Memory - Reserved Memory for OS - Memory for Other Tasks -
innodb_buffer_pool_size: 70% of available memory
innodb_buffer_pool_size = Available Memory * 0.7 -
max_connections: 100 connections per GB of available memory
max_connections = Available Memory (in GB) * 100 -
key_buffer_size: 10% of available memory
key_buffer_size = Available Memory * 0.1 -
innodb_log_file_size: 25% of innodb_buffer_pool_size
innodb_log_file_size = innodb_buffer_pool_size * 0.25
-
query_cache_size: 5% of available memory
query_cache_size = Available Memory * 0.05 -
tmp_table_size: 5% of available memory
tmp_table_size = Available Memory * 0.05 -
innodb_log_buffer_size: 1% of available memory, capped at 8MB
innodb_log_buffer_size = min(Available Memory * 0.01, 8MB) -
innodb_flush_log_at_trx_commit: Set to 1 for ACID compliance
-
innodb_flush_method: Set to 'O_DIRECT' for most cases
-
innodb_file_per_table: Set to 1 to enable
-
innodb_io_capacity: 100 IOPS per GB of available memory
innodb_io_capacity = Available Memory (in GB) * 100 -
innodb_read_io_threads and innodb_write_io_threads: Set to 4 each
-
innodb_thread_concurrency: Set to 0 (auto-configure)
-
sort_buffer_size: 2% of available memory, capped at 262144 bytes
sort_buffer_size = min(Available Memory * 0.02, 262144) -
read_buffer_size: 1% of available memory, capped at 262144 bytes
read_buffer_size = min(Available Memory * 0.01, 262144) -
read_rnd_buffer_size: 1% of available memory, capped at 524288 bytes
read_rnd_buffer_size = min(Available Memory * 0.01, 524288) -
join_buffer_size: 1% of available memory, capped at 262144 bytes
join_buffer_size = min(Available Memory * 0.01, 262144)
Please note that these calculations are based on general best practices and may need to be adjusted for specific use cases. Always monitor your database performance and adjust settings accordingly.
Contributing
Contributions to the MySQL/MariaDB Settings Calculator are welcome! Here's how you can contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/YourFeature) - Make your changes
- Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
Please ensure your code adheres to the existing style and that you've tested your changes thoroughly.
Useful Commands
- Continuously watch for changes in the
style.cssfile, updating the output file whenever changes occur.
npx @tailwindcss/cli -i ./assets/css/styles.css -o ./assets/css/styles.min.css --watch
- Generate a minified version of the CSS
npx @tailwindcss/cli -i ./assets/css/styles.css -o ./assets/css/styles_min.css --minify
License
This project is open source and available under the MIT License.
Author
Created by Gabriel Kanev
Acknowledgments
- MySQL Documentation
- MariaDB Documentation
- All contributors who have helped improve this calculator
For any questions, issues, or suggestions, please open an issue on the GitHub repository.