Subscribe to How-To Geek Mag-subscribe sa Paano-Upang Geek

Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Using a MySQL Performance Tuning Analyzer Script Gamit ang isang MySQL Pagganap 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. Kapag ikaw ay nagtatrabaho sa pagtaas ng bilis ng iyong website, isang napakahalagang piraso ay siguraduhin makuha na ninyo ang bawat huling drop ng pagganap ng iyong mga database ng server. Unfortunately, for most of us that aren't normally database administrators this can be a difficult proposition. Sa kasamaang palad, para sa karamihan sa atin na hindi normal sa database administrator na ito ay maaaring maging isang mahirap na tanong.

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. May isang numero ng pagganap tune sa mga script na pag-aralan ang mga setting ng iyong server at kasalukuyang kalagayan at magbigay sa iyo ng impormasyon tungkol sa mga pinapayong mga pagbabago na dapat mong gawin. You shouldn't necessarily follow all of the suggestions, but it's worthwhile to take a look at anyway. Hindi kinakailangan mo dapat sundin ng lahat ng mga mungkahi, ngunit ito ay kapaki-pakinabang upang tingnan pa rin.

The script I've been using gives you recommendations for the following: Ang script ko na ang gamit ay nagbibigay sa iyo ng mga rekomendasyon para sa mga sumusunod:

  • Slow Query Log Mabagal Query Lumikha ng account
  • Max Connections Max Connections
  • Worker Threads Worker Threads
  • Key Buffer Key Buffer
  • Query Cache Query Cache
  • Sort Buffer Pagsunud-sunurin ayon Buffer
  • Joins Pagsali
  • Temp Tables Temp Tables
  • Table (Open & Definition) Cache Table (Buksan & Definition) Cache
  • Table Locking Talaan ng pagsasara ng
  • Table Scans (read_buffer) Talaan Sinusuri (read_buffer)
  • Innodb Status Innodb Kalagayan
  • Once you download the script, you'll need to make it executable with the following command: Kapag i-download ang script, kailangan mong gumawa ng mga ito maipapatupad na may mga sumusunod na command:

    chmod u+x tuning-primer.sh u chmod + x tune-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. Kung patakbuhin mo ang script na ito bilang isang regular na mga gumagamit, ito nasain udyukan ka para sa iyong password, kaya kailangan mong siguraduhin na mag-set ng access naaayon. If you run it as root it'll pick up the mysql password from Plesk if you have that installed. Kung patakbuhin mo ito na ugat ito ay kunin ang MySQL password mula sa Plesk kung kayo ay na-install na.

    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. Ko na tanggalin ang isang pulutong ng output, na kung saan ay nagkaroon ng mas maraming mga rekomendasyon, ngunit lamang ay masyadong mahaba upang magkasya sa pahina.

    ./tuning-primer.sh . / tune-primer.sh

    — MYSQL PERFORMANCE TUNING PRIMER – - MySQL PAGGANAP Tuning panimulang aklat --
    – By: Matthew Montgomery – - By: Mateo Montgomery --

    MySQL Version 4.1.20 i686 MySQL 4.1.20 Version i686

    Uptime = 5 days 10 hrs 46 min 5 sec Uptime = 5 araw 10 oras 46 min 5 sec
    Avg. Avg. qps = 4 qps = 4
    Total Questions = 2020809 Kabuuang Tanong = 2020809
    Threads Connected = 1 Threads Konektado = 1

    Server has been running for over 48hrs. Server ay tumatakbo para sa paglipas ng 48hrs.
    It should be safe to follow these recommendations Ito ay dapat maging ligtas sa mga sumusunod na mga mungkahi

    ———– snipped ————– ---- Snipped -----

    QUERY CACHE Query sa cache
    Query cache is enabled Query cache ay naka-enable
    Current query_cache_size = 8 M Kasalukuyang query_cache_size = 8 M
    Current query_cache_used = 7 M Kasalukuyang query_cache_used = 7 M
    Current query_cach_limit = 1 M Kasalukuyang query_cach_limit = 1 M
    Current Query cache fill ratio = 89.38 % Kasalukuyang Query cache punan ang ratio = 89.38%
    However, 254246 queries have been removed from the query cache due to lack of memory Gayunman, ang 254,246 mga tanong ay tinanggal mula sa cache ng tanong dahil sa kakulangan ng memorya
    Perhaps you should raise query_cache_size Siguro dapat mong taasan query_cache_size
    MySQL won't cache query results that are larger than query_cache_limit in size MySQL ay hindi cache ng query sa mga resulta na mas malaki kaysa sa query_cache_limit sa laki

    ———– snipped ————– ---- Snipped -----

    Looks like I need to Mukhang kailangan kong increase my query cache dagdagan ang aking mga tanong sa cache … I set it to only 8MB but it's cleaning out the cache far too often. ... Ako magse-set ito sa 8MB lamang ngunit ito ay paglilinis ang cache ng malayo masyadong madalas.

    ———– snipped ————– ---- Snipped -----

    TEMP TABLES TEMP mesa
    Current max_heap_table_size = 16 M Kasalukuyang max_heap_table_size = 16 M
    Current tmp_table_size = 32 M Kasalukuyang tmp_table_size = 32 M
    Of 35170 temp tables, 74% were created on disk Ng 35,170 mga talahanayan ng temp, 74% ay nilikha sa disk
    Effective in-memory tmp_table_size is limited to max_heap_table_size. Epektibo sa-memorya tmp_table_size ay limitado sa max_heap_table_size.
    Perhaps you should increase your tmp_table_size and/or max_heap_table_size Siguro dapat mong madagdagan ang iyong tmp_table_size at / o max_heap_table_size
    to reduce the number of disk-based temporary tables upang mabawasan ang bilang ng mga disk na nakabatay sa pansamantalang mesa
    Note! Tandaan! BLOB and TEXT columns are not allow in memory tables. Patak at TEXT haligi ay hindi nagpapahintulot sa mga talahanayan ng memorya.
    If you are using these columns raising these values might not impact your Kung ikaw ay gumagamit ng mga haligi sa pagpapalaki ng mga halagang ito ay maaring hindi magkaroon nang epekto sa iyong
    ratio of on disk temp tables. ratio ng mesa sa disk temp.

    ———– snipped ————– ---- Snipped -----

    This type of information is just invaluable when you are trying to tune the performance of your website. Ang uri ng impormasyon ay napakahalaga lamang kapag ikaw ay sinusubukan upang ibagay ang performance ng iyong website.

    Download MySQL Performance Tuning Primer Script I-download ang MySQL Performance Tuning panimulang aklat sa pagbasa Script

    This article was originally written on 10/4/07 Tagged with: Ang artikulong ito ay orihinal na isinulat sa 10/4/07 Tagged with: Linux Linux

    Daily Email Updates Araw-araw na Updates Email

    You can get our how-to articles in your inbox each day for free. Maaari kang makakuha ng aming kung-paano na mga artikulo sa iyong inbox sa bawat araw para sa libre. Just enter your name and email below: Ilagay lamang ang inyong pangalan at email sa ibaba:


    Name: Pangalan:
    Email: Email:

    Comments (8) Comments (8)

    1. bushido bushido

      ./tuning-primer.sh: line 1164: bc: command not found . / tune-primer.sh: 1,164 linya: BC: utos hindi natagpuan
      ./tuning-primer.sh: line 1197: [: -gt: unary operator expected . / tune-primer.sh: 1,197 linya: [:-gt: unary operator inaasahan
      ./tuning-primer.sh: line 350: [: max_memoryHR: integer expression expected . / tune-primer.sh: linya ng 350: [: max_memoryHR: integer expression inaasahan
      ./tuning-primer.sh: line 356: [: max_memoryHR: integer expression expected . / tune-primer.sh: linya ng 356: [: max_memoryHR: integer expression inaasahan
      ----------- [ chopped by editor for length] ————— ----------- [Tinadtad ng editor para sa haba] -----
      TABLE SCANS TALAAN Sinusuri
      ./tuning-primer.sh: line 331: bc: command not found . / tune-primer.sh: line 331: BC: utos hindi natagpuan
      Current read_buffer_size = K Kasalukuyang read_buffer_size = K
      Current table scan ratio = 7 : 1 Kasalukuyang mesa i-scan ang ratio = 7: 1
      read_buffer_size seems to be fine read_buffer_size anyong pagmultahin

      plese help. paki tulong.

    2. The Geek Ang Geek

      bushido: bushido:

      The problem you are having is that you are missing some of the utilities required by the script. Ang problema mo ay nagkakaroon na ikaw ay nawawala ang ilan sa mga kagamitan na kinakailangan sa pamamagitan ng script. You'll have to install the missing utilities, such as bc. Kailangan ninyong i-install ang mga nawawalang kagamitan, tulad ng BC.

    3. Matthew Montgomery Mateo Montgomery

      Thanks for using my script Salamat sa paggamit ng aking script :-)

      If you do see any bugs or recommendations that seem ill advised please let me know. Kung mo makikita ang anumang bugs o mga rekomendasyon na tila walang pinapayuhan pakisabi sa akin. My e-mail address is found inside the script header. My e-mail address ay matatagpuan sa loob ng header ng script.

      Thanks Salamat
      Matt Matt

    4. Torzak Torzak

      Check also MysqlTunner : Suriin din MysqlTunner:
      http://rackerhacker.com/mysqltuner/ http://rackerhacker.com/mysqltuner/

      Antoher good script for auto tunning your mysql server Antoher magandang script para sa auto tunning iyong MySQL server

    5. Craig M. Rosenblum Craig M. Rosenblum

      Is there anything like this for windows users? Mayroon bang anumang tulad nito para sa mga bintana ng mga user?

    6. Steve Bacher Steve Bacher

      I made a slight modification to the cecho function so the output can be optionally directed to a file: Ko na ginawa ng bahagyang pagbabago sa function cecho kaya output ay maaaring opsyonal itinuro sa isang file:

      [ -t 1 ] && echo -e “$color” [T-1] & & echo-e "$ kulay"
      echo -e “$message” echo-e "$ mensahe"
      [ -t 1 ] && tput sgr0 # Reset to normal. [T-1] & & tput sgr0 # I-reset sa normal.
      [ -t 1 ] && echo -e “$black” [T-1] & & echo-e "$ itim"
      return bumalik

      (I also changed the yellow and green settings because I can never read yellow on my xterm window.) (Ako din nagbago ang dilaw at luntiang mga setting dahil hindi ko maaaring basahin ang dilaw na sa aking xterm window.)

      – seb - Seb

    7. Robert Robert

      Anyone have a windows equivalent? Kahit sino ay may katumbas na bintana?

    8. David O'Dwyer David O'Dwyer

      For anyone getting a “unexpected operator” error on startup please try changing the default shell Para sa kahit sino sa pagkuha ng isang "di inaasahang operator" error sa startup mangyaring subukan ang pagpapalit ng mga default na shell
      from: mula sa:
      #!/bin/sh #! / bin / SH
      to: sa:
      #!/bin/bash #! / bin / Bash
      this fixed the problem for me on my Ubuntu 8.04 box ito naayos ang problema para sa akin sa aking kahon ng Ubuntu 8.04


    Our Friends Ang aming mga Friends
    Getting Started Pagsisimula


    About How-To Geek Tungkol sa Paano-Upang Geek
    What Is That Process? Ano ba ang Proseso Iyon?
    svchost.exe svchost.exe
    jusched.exe jusched.exe
    dwm.exe dwm.exe
    ctfmon.exe ctfmon.exe
    wmpnetwk.exe wmpnetwk.exe
    mDNSResponder.exe mDNSResponder.exe
    wmpnscfg.exe wmpnscfg.exe
    rundll32.exe rundll32.exe
    wfcrun32.exe wfcrun32.exe
    Ipoint.exe Ipoint.exe
    Itype.exe Itype.exe
    Wfica32.exe Wfica32.exe
    Mobsync.exe Mobsync.exe
    conhost.exe conhost.exe
    Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

    Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.