Using a MySQL Performance Tuning Analyzer Script Використання MySQL Performance Tuning Analyzer Script
When you are working on increasing the speed of your website, a very important piece is making sure you get every last drop of performance out of your database server. Коли ви працюєте над підвищенням швидкості вашого сайту, дуже важлива частина робить, що ви отримаєте все до останньої краплі від продуктивність від вашого сервера баз даних. Unfortunately, for most of us that aren't normally database administrators this can be a difficult proposition. На жаль, для більшості з нас, які зазвичай не адміністратори баз даних, це може бути складною справою.
There's a number of performance tuning scripts that will analyze your server settings and current status and give you information on recommended changes that you should make. Там, ряд Performance Tuning сценарії, які будуть аналізувати ваші настройки сервера і поточний статус і надати вам інформацію про рекомендовані змін, що ви повинні зробити. You shouldn't necessarily follow all of the suggestions, but it's worthwhile to take a look at anyway. Ви не обов'язково повинні стежити всі ці пропозиції, однак, має сенс поглянути на будь-якому випадку.
The script I've been using gives you recommendations for the following: Сценарій я використовую дає вам рекомендації для наступних цілей:
Once you download the script, you'll need to make it executable with the following command: Після завантаження сценарію, вам необхідно зробити його виконуваним з допомогою наступної команди:
chmod u+x tuning-primer.sh CHMOD U + X тюнінг-primer.sh
If you run this script as a regular user, it will prompt you for your password, so you'll have to make sure to set access accordingly. Якщо ви запустите цей сценарій в якості звичайного користувача, вона попросить вас ввести пароль, тому ви повинні переконатися, встановити обмеження на доступ відповідно. If you run it as root it'll pick up the mysql password from Plesk if you have that installed. Якщо ви запустите його як кореневого вона буде забрати MySQL пароль від Plesk, якщо у вас є, що встановлений.
I've cut out a lot of the output, which had a lot more recommendations, but was just too long to fit on the page. Я вирізав багато продукції, яка була набагато більше рекомендацій, але було дуже довгий і не вміщується на сторінку.
./tuning-primer.sh . / Тюнінг-primer.sh
— MYSQL PERFORMANCE TUNING PRIMER – - MySQL Performance Tuning Primer --
– By: Matthew Montgomery – - Автор: Matthew Montgomery --MySQL Version 4.1.20 i686 Версія MySQL 4.1.20 i686
Uptime = 5 days 10 hrs 46 min 5 sec Uptime = 5 днів 10 годині 46 хв 5 сек
Avg. Ср qps = 4 QPS = 4
Total Questions = 2020809 Всього Питання = 2020809
Threads Connected = 1 Threads Connected = 1Server has been running for over 48hrs. Сервер працює вже протягом більше 48 годин.
It should be safe to follow these recommendations Вона повинна бути безпечною, щоб дотримуватися цих рекомендацій———– snipped ————– ---- Пропущено -----
QUERY CACHE QUERY CACHE
Query cache is enabled Включена кеш запитів
Current query_cache_size = 8 M Поточні query_cache_size = 8 м
Current query_cache_used = 7 M Поточні query_cache_used = 7 M
Current query_cach_limit = 1 M Поточні query_cach_limit = 1 м
Current Query cache fill ratio = 89.38 % Поточний запит кеш заповнити відношення = 89,38%
However, 254246 queries have been removed from the query cache due to lack of memory Однак, 254246 запити були видалені з кешу запитів з-за браку пам'яті
Perhaps you should raise query_cache_size Може бути, ви повинні підняти query_cache_size
MySQL won't cache query results that are larger than query_cache_limit in size MySQL не буде кеша результатів запиту, розмір яких перевищує розмір query_cache_limit———– snipped ————– ---- Пропущено -----
Looks like I need to Схоже, мені потрібно increase my query cache підвищувати свій кеш запитів … I set it to only 8MB but it's cleaning out the cache far too often. ... Я можу встановити її тільки 8MB але очищення кешу занадто часто.
———– snipped ————– ---- Пропущено -----
TEMP TABLES TEMP TABLES
Current max_heap_table_size = 16 M Поточні max_heap_table_size = 16 M
Current tmp_table_size = 32 M Поточні tmp_table_size = 32 M
Of 35170 temp tables, 74% were created on disk З 35170 таблиць Temp, 74% були створені на диску
Effective in-memory tmp_table_size is limited to max_heap_table_size. Ефективне в пам'яті tmp_table_size обмежується max_heap_table_size.
Perhaps you should increase your tmp_table_size and/or max_heap_table_size Можливо, вам слід збільшити tmp_table_size та / або max_heap_table_size
to reduce the number of disk-based temporary tables скоротити кількість звернень до диска основі тимчасових таблиць
Note! Примітка! BLOB and TEXT columns are not allow in memory tables. BLOB і TEXT стовпці, не дозволяють у пам'ять таблиць.
If you are using these columns raising these values might not impact your Якщо ви використовуєте ці стовпці підняти ці цінності не можуть впливати на вашу
ratio of on disk temp tables. Ставлення до таблиць диска темп.———– snipped ————– ---- Пропущено -----
This type of information is just invaluable when you are trying to tune the performance of your website. Такого роду інформація є просто неоціненною, коли ви намагаєтеся налаштовувати продуктивність вашого сайту.
Download MySQL Performance Tuning Primer Script Завантажити MySQL Performance Tuning Primer Script

Daily Email Updates Email Щоденні оновлення
You can get our how-to articles in your inbox each day for free. Ви можете отримати наші довідкові статті у Вашу поштову скриньку щодня безкоштовно. Just enter your name and email below: Просто введіть ваші ім'я та адресу електронної пошти нижче:



./tuning-primer.sh: line 1164: bc: command not found . / Тюнінг-primer.sh: Line 1164: BC: команда не знайдена
./tuning-primer.sh: line 1197: [: -gt: unary operator expected . / Тюнінг-primer.sh: Line 1197: [:-GT: унарні оператори, очікувані
./tuning-primer.sh: line 350: [: max_memoryHR: integer expression expected . / Тюнінг-primer.sh: рядок 350: [: max_memoryHR: цілочисельне вираз очікуваного
./tuning-primer.sh: line 356: [: max_memoryHR: integer expression expected . / Тюнінг-primer.sh: рядок 356: [: max_memoryHR: цілочисельне вираз очікуваного
----------- [ chopped by editor for length] ————— ----------- [Chopped редактора по довжині] -----
TABLE SCANS Сканування таблиці
./tuning-primer.sh: line 331: bc: command not found . / Тюнінг-primer.sh: рядок 331: BC: команда не знайдена
Current read_buffer_size = K Поточні read_buffer_size = K
Current table scan ratio = 7 : 1 Поточне сканування таблиці співвідношення = 7: 1
read_buffer_size seems to be fine read_buffer_size здається, буде добре
plese help. впісатьтся допомогу.
bushido: Бусідо:
The problem you are having is that you are missing some of the utilities required by the script. Проблеми ви відчуваєте те, що вам не вистачає деяких утиліт вимагає сценарій. You'll have to install the missing utilities, such as bc. Ви повинні встановити відсутні комунальні послуги, такі, як до нашої ери.
Thanks for using my script Дякуємо за використання мого скрипта
If you do see any bugs or recommendations that seem ill advised please let me know. Якщо ви бачите помилки чи рекомендацій, які, здається недоцільно будь ласка, дайте мені знати. My e-mail address is found inside the script header. Моя адреса електронної пошти знаходиться всередині сценарію заголовку.
Thanks Спасибо
Matt Метт
Check also MysqlTunner : MysqlTunner Дивись також:
http://rackerhacker.com/mysqltuner/ http://rackerhacker.com/mysqltuner/
Antoher good script for auto tunning your mysql server Antoher хороший скрипт для автоматичного Tunning вашому сервері MySQL
Is there anything like this for windows users? Чи є щось подібне для користувачів Windows?
I made a slight modification to the cecho function so the output can be optionally directed to a file: Я зробив невелика зміна в cecho функцію, так що вихід може бути додатково спрямовано на файл:
[ -t 1 ] && echo -e “$color” [-T 1] & & Echo-E "$ колір"
echo -e “$message” Ехо-E "$ сполучення"
[ -t 1 ] && tput sgr0 # Reset to normal. [-T 1] & & tput sgr0 # Скидання до нормального життя.
[ -t 1 ] && echo -e “$black” [-T 1] & & Echo-E "$ чорне"
return повернення
(I also changed the yellow and green settings because I can never read yellow on my xterm window.) (Я також змінив жовтий та зелений настройками, тому що я ніколи не читав жовту Xterm на моєму вікні.)
– seb - SEB
Anyone have a windows equivalent? Будь-хто Windows еквівалент?
For anyone getting a “unexpected operator” error on startup please try changing the default shell Для тих, хто отримував "несподіваний оператор" Помилка при запуску Будь ласка, спробуйте змінити настройки оболонки за замовчуванням
from: від:
#!/bin/sh #! / BIN / Ш.
to: до:
#!/bin/bash #! / BIN / Bash
this fixed the problem for me on my Ubuntu 8.04 box ця проблема вирішена за мене на Ubuntu 8.04 вікні