MariaDB में mysqltuner का उपयोग करके हल्का ट्यूनिंग करना
नमस्ते, मैं अक्षम हूँ।
समय बिताने के लिए, मैं MariaDB में कुछ करने लायक चीज़ों की तलाश कर रहा था, और मुझे mysqltuner नामक MySQL ट्यूनिंग सॉफ़्टवेयर मिला, तो मैंने इसे इंस्टॉल कर लिया।
इंस्टॉलेशन
Devuan में, इसे इस प्रकार इंस्टॉल करें:
sudo apt install mysqltuner
चलाना
यह कुछ इस तरह से इंटरैक्टिव रूप से शुरू होता है।
$ mysqltuner
>> MySQLTuner 1.9.9
* Jean-Marie Renouard <jmrenouard@gmail.com>
* Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.pl/
>> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:
अंत में, यह कुछ इस तरह से दिखाई दिया।
General recommendations:
You are using n unsupported version for production environments
Upgrade as soon as possible to a supported version !
Reduce or eliminate unclosed connections and network issues
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
See https://dev.mysql.com/doc/internals/en/join-buffer-size.html
(specially the conclusions at the bottom of the page).
Performance schema should be activated for better diagnostics
Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: https://bit.ly/2TcGgtU
Variables to adjust:
skip-name-resolve=1
join_buffer_size (> 256.0K, or always use indexes with JOINs)
table_definition_cache(400) > 585 or -1 (autosizing if supported)
performance_schema=ON
innodb_buffer_pool_size (>= 1.3G) if possible.
innodb_log_file_size should be (=32M) if possible, so InnoDB total log files size equals 25% of buffer pool size.
ऐसा लगता है कि DNS नाम रिज़ॉल्यूशन को छोड़ देना बेहतर है।
※यह एक चाल भी हो सकती है, इसलिए यदि आप MariaDB के भीतर user@localhost का उपयोग कर रहे हैं तो इसे छोड़ देना बेहतर हो सकता है।: जब skip-name-resolve लिखने पर DB से कनेक्ट नहीं हो पाता है – netcreates. blog
इसलिए, मैंने grep -r mysqld का उपयोग करके संबंधित अनुभाग की conf फ़ाइल खोजी, और यह /etc/mysql/mariadb.conf.d/50-server.cnf पथ पर थी, तो मैंने इसे जोड़ा।
और, ऐसा लगता है कि join_buffer_size के आकार को समायोजित करना बेहतर होगा, इसलिए मैं इसे बदल रहा हूँ।
टेबल परिभाषा कैश को भी कॉन्फ़िगर करना बेहतर होगा, इसलिए मैं इसे बदल रहा हूँ।
ऐसा लगता है कि innodb लॉग फ़ाइल के आकार को भी निर्दिष्ट करना बेहतर होगा ताकि यह बहुत बड़ा न हो।
मैंने innodb पूल का आकार भी निर्दिष्ट किया, लेकिन इसे काफी छोटा रखा।
[mysqld]
skip-name-resolve=1
join_buffer_size = 512K
table_definition_cache = 600
innodb_log_file_size = 32M
innodb_buffer_pool_size = 2G
यदि यह पहले से ही सिंटैक्स में टिप्पणी किया गया है, तो उस टिप्पणी को हटा दें, उपरोक्त सेटिंग्स को लागू करें और MariaDB को पुनरारंभ करें।
sudo service mariadb restart
और फिर, mysqltuner को फिर से चलाने का परिणाम।
General recommendations:
You are using n unsupported version for production environments
Upgrade as soon as possible to a supported version !
MySQL was started within the last 24 hours - recommendations may be inaccurate
We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
See https://dev.mysql.com/doc/internals/en/join-buffer-size.html
(specially the conclusions at the bottom of the page).
Performance schema should be activated for better diagnostics
Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: https://bit.ly/2TcGgtU
Variables to adjust:
join_buffer_size (> 512.0K, or always use indexes with JOINs)
performance_schema=ON
innodb_log_file_size should be (=512M) if possible, so InnoDB total log files size equals 25% of buffer pool size.
मैं performance_schema को सक्षम नहीं करना चाहता, और अन्य कोई भी गंभीर समस्या नहीं बची है, इसलिए मैं इसे यहीं तक रखता हूँ।
तो, यहीं तक। फिर मिलेंगे।