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 সক্রিয় করতে চাই না, এবং অন্য কোনো কঠোর সমস্যাও নেই, তাই আপাতত এখানেই থামব।
এই পর্যন্তই। আবার দেখা হবে।