• 24-01-2015, 22:28:07
    #1
    Mysql CPU %150 ile 400 arası kullanmakta. Sebebini nasıl öğrenebilir miyim ve çözüm için önereceğiniz bir şey var mı acaba?
  • 25-01-2015, 14:44:37
    #2
    arkadaşlar yardımcı olacak kimse yok mu? ssh üzerinden top komutunu verdiğimde şöyle bir şey çıkıyor.



    mysql optimasyonu mu yapmam lazım acaba?
  • 25-01-2015, 19:12:16
    #3
    Üyeliği durduruldu
    merhaba

    mysql mycnf optimizasyonu yapınız.siteler kafasına göre mysql kullanımı yapmasında bu tür problemler çok yaşanmaktadır
  • 26-01-2015, 04:36:15
    #4
    LineDatacenter adlı üyeden alıntı: mesajı görüntüle
    merhaba

    mysql mycnf optimizasyonu yapınız.siteler kafasına göre mysql kullanımı yapmasında bu tür problemler çok yaşanmaktadır
    mycnf optimizasyonu yapmasını bilmiyorum maalesef. ben diğer mesajlarınız için de r10+ verdim hocam. teşekkürler cevaplarınız için.
  • 26-01-2015, 10:06:27
    #5
    Üyeliği durduruldu
    Misafir adlı üyeden alıntı: mesajı görüntüle
    mycnf optimizasyonu yapmasını bilmiyorum maalesef. ben diğer mesajlarınız için de r10+ verdim hocam. teşekkürler cevaplarınız için.
    merhaba

    ssh den bağlanıp aşşağıdaki kodları giriniz.çıktı verecektir onu iletirseniz my.cnf ayarlarınızı ileteyim

    cd ~
    wget https://raw.github.com/rackerhacker/MySQLTuner-perl/master/mysqltuner.pl
    chmod 777 mysqltuner.pl
    ./mysqltuner.pl
  • 26-01-2015, 14:13:37
    #6
    Konuyu görünce bende değerlerimi vereyim dedim. Çıktı şu şekilde benim için ne önerirsiniz acaba hocam ?

     >>  MySQLTuner 1.4.0 - Major Hayden <major@mhtx.net>
     >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
     >>  Run with '--help' for additional options and output filtering
    [OK] Currently running supported MySQL version 5.6.22
    [!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
    [--] Data in MyISAM tables: 628M (Tables: 631)
    [--] Data in InnoDB tables: 742M (Tables: 676)
    [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
    [--] Data in MEMORY tables: 71M (Tables: 10)
    [!!] Total fragmented tables: 86
    
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 9d 2h 0m 45s (66M q [84.159 qps], 887K conn, TX: 244B, RX: 8B)
    [--] Reads / Writes: 91% / 9%
    [--] Total buffers: 7.2G global + 72.4M per thread (500 max threads)
    [!!] Allocating > 2GB RAM on 32-bit systems can cause system instability
    [!!] Maximum possible memory usage: 42.6G (288% of installed RAM)
    [OK] Slow queries: 0% (29/66M)
    [OK] Highest usage of available connections: 6% (34/500)
    [OK] Key buffer size / total MyISAM indexes: 768.0M/190.0M
    [OK] Key buffer hit rate: 99.6% (69M cached / 264K reads)
    [OK] Query cache efficiency: 87.8% (54M cached / 61M selects)
    [!!] Query cache prunes per day: 7621
    [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 494K sorts)
    [!!] Joins performed without indexes: 9090
    [!!] Temporary tables created on disk: 68% (159K on disk / 234K total)
    [OK] Thread cache hit rate: 99% (97 created / 887K connections)
    [!!] Table cache hit rate: 0% (512 open / 102K opened)
    [OK] Open file limit used: 0% (470/50K)
    [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)
    [!!] InnoDB  buffer pool / data size: 128.0M/742.1M
    [OK] InnoDB log waits: 0
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Increasing the query_cache size over 128M may reduce performance
        Adjust your join queries to always utilize indexes
        Temporary table size is already large - reduce result set size
        Reduce your SELECT DISTINCT queries without LIMIT clauses
        Increase table_open_cache gradually to avoid file descriptor limits
        Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    Variables to adjust:
      *** MySQL's maximum memory usage is dangerously high ***
      *** Add RAM before increasing MySQL buffer variables ***
        query_cache_size (> 256M) [see warning above]
        join_buffer_size (> 24.0M, or always use indexes with joins)
        table_open_cache (> 512)
        innodb_buffer_pool_size (>= 742M)
    my.cnf dosyamda şu şekilde hocam.

    [myisamchk]
    tmpdir="/tmp"
    sort_buffer=64M
    write_buffer=16M
    key_buffer=256M
    read_buffer=16M
    [isamchk]
    sort_buffer_size=256M
    write_buffer=2M
    key_buffer=256M
    read_buffer=2M
    [mysqld]
    query_cache_limit=64M
    query_cache_type=1
    #thread_concurrency=64
    myisam_sort_buffer_size=256M
    thread_cache_size=256M
    open_files_limit=50000
    table_open_cache=15000
    interactive_timeout=30
    max_heap_table_size=6192M
    innodb_additional_mem_pool_size=32M
    innodb_buffer_pool_size=134217728
    key_buffer_size=768M
    query_cache_size=256M
    join_buffer_size=24M
    innodb_flush_method=O_DIRECT
    max_connect_errors=5
    max_allowed_packet=268435456
    #skip-networking
    sort_buffer_size=24M
    table_open_cache=512
    innodb_thread_concurrency=16
    local-infile=0
    read_buffer_size=24M
    max_connections=500
    tmpdir="/tmp"
    connect_timeout=60
    wait_timeout=30
    tmp_table_size=6192M
    max_user_connections=1000
    table_definition_cache=12K
    default-storage-engine=MyISAM
    innodb_file_per_table=1
    skip-networking
    #bind-address=0.0.0.0
    table_cache = 1000
  • 26-01-2015, 14:48:31
    #7
    Üyeliği durduruldu
    hasip adlı üyeden alıntı: mesajı görüntüle
    Konuyu görünce bende değerlerimi vereyim dedim. Çıktı şu şekilde benim için ne önerirsiniz acaba hocam ?

     >>  MySQLTuner 1.4.0 - Major Hayden <major@mhtx.net>
     >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
     >>  Run with '--help' for additional options and output filtering
    [OK] Currently running supported MySQL version 5.6.22
    [!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
    [--] Data in MyISAM tables: 628M (Tables: 631)
    [--] Data in InnoDB tables: 742M (Tables: 676)
    [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
    [--] Data in MEMORY tables: 71M (Tables: 10)
    [!!] Total fragmented tables: 86
    
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 9d 2h 0m 45s (66M q [84.159 qps], 887K conn, TX: 244B, RX: 8B)
    [--] Reads / Writes: 91% / 9%
    [--] Total buffers: 7.2G global + 72.4M per thread (500 max threads)
    [!!] Allocating > 2GB RAM on 32-bit systems can cause system instability
    [!!] Maximum possible memory usage: 42.6G (288% of installed RAM)
    [OK] Slow queries: 0% (29/66M)
    [OK] Highest usage of available connections: 6% (34/500)
    [OK] Key buffer size / total MyISAM indexes: 768.0M/190.0M
    [OK] Key buffer hit rate: 99.6% (69M cached / 264K reads)
    [OK] Query cache efficiency: 87.8% (54M cached / 61M selects)
    [!!] Query cache prunes per day: 7621
    [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 494K sorts)
    [!!] Joins performed without indexes: 9090
    [!!] Temporary tables created on disk: 68% (159K on disk / 234K total)
    [OK] Thread cache hit rate: 99% (97 created / 887K connections)
    [!!] Table cache hit rate: 0% (512 open / 102K opened)
    [OK] Open file limit used: 0% (470/50K)
    [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)
    [!!] InnoDB  buffer pool / data size: 128.0M/742.1M
    [OK] InnoDB log waits: 0
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Increasing the query_cache size over 128M may reduce performance
        Adjust your join queries to always utilize indexes
        Temporary table size is already large - reduce result set size
        Reduce your SELECT DISTINCT queries without LIMIT clauses
        Increase table_open_cache gradually to avoid file descriptor limits
        Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
    Variables to adjust:
      *** MySQL's maximum memory usage is dangerously high ***
      *** Add RAM before increasing MySQL buffer variables ***
        query_cache_size (> 256M) [see warning above]
        join_buffer_size (> 24.0M, or always use indexes with joins)
        table_open_cache (> 512)
        innodb_buffer_pool_size (>= 742M)
    my.cnf dosyamda şu şekilde hocam.

    [myisamchk]
    tmpdir="/tmp"
    sort_buffer=64M
    write_buffer=16M
    key_buffer=256M
    read_buffer=16M
    [isamchk]
    sort_buffer_size=256M
    write_buffer=2M
    key_buffer=256M
    read_buffer=2M
    [mysqld]
    query_cache_limit=64M
    query_cache_type=1
    #thread_concurrency=64
    myisam_sort_buffer_size=256M
    thread_cache_size=256M
    open_files_limit=50000
    table_open_cache=15000
    interactive_timeout=30
    max_heap_table_size=6192M
    innodb_additional_mem_pool_size=32M
    innodb_buffer_pool_size=134217728
    key_buffer_size=768M
    query_cache_size=256M
    join_buffer_size=24M
    innodb_flush_method=O_DIRECT
    max_connect_errors=5
    max_allowed_packet=268435456
    #skip-networking
    sort_buffer_size=24M
    table_open_cache=512
    innodb_thread_concurrency=16
    local-infile=0
    read_buffer_size=24M
    max_connections=500
    tmpdir="/tmp"
    connect_timeout=60
    wait_timeout=30
    tmp_table_size=6192M
    max_user_connections=1000
    table_definition_cache=12K
    default-storage-engine=MyISAM
    innodb_file_per_table=1
    skip-networking
    #bind-address=0.0.0.0
    table_cache = 1000
    merhaba

    herşeyden önce 64 bit işletim sistemi kurmanızı öneriyor
  • 26-01-2015, 15:04:24
    #8
    Malesef kullandığım bazı sistemlerden dolayı 64 bit geçemiyorum Onun dışında gözünüze çarpan bir aksaklık varmı hocam.
  • 26-01-2015, 15:16:34
    #9
    Üyeliği durduruldu
    hasip adlı üyeden alıntı: mesajı görüntüle
    Malesef kullandığım bazı sistemlerden dolayı 64 bit geçemiyorum Onun dışında gözünüze çarpan bir aksaklık varmı hocam.
    merhaba

    ram yetersiz geliyor.ek olarak daha fazla bilgiye ihtiyaç var.disk yapısı nedir.

    innodb_buffer_pool_size değerini 1g yaparmısınız.