• 10-05-2010, 02:21:55
    #1
    Üyeliği durduruldu
    Merhaba arkadaşlar, VPS sunucumda uzun zamandır aşırı MySQL kullanımı olduğundan sık sık kesinti oluyor. Özellikle hafta sonları MySQL kullanımı %100'lere kadar çıkıyor ve haliyle VPS kapatılıyor. Hostcu sunucu kaynaklı bir durum olmadığını ve optimize yaptırmam gerektiğini söylüyor. Bu konuda hiçbir fikrim olmadığından sizlerden yardım istemeye karar verdim.

    Sunucu özellikleri:

    Alıntı
    Processor #1 Vendor: GenuineIntel
    Processor #1 Name: Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz
    Processor #1 speed: 2833.789 MHz
    Processor #1 cache size: 8192 KB
    Ram bilgileri:

    Alıntı
    total used free shared buffers cached
    Mem: 2097152 595560 1501592 0 0 0
    -/+ buffers/cache: 595560 1501592
    Swap: 0 0 0
    Total: 2097152 595560 1501592
    Apache 2.2.15, PHP 5.3.2 ve MySQL 5.0.90 kullanıyorum. Şuanki my.cnf dosyası boş. Sitelere gelirsek; biri SMF tabanlı forum ve diğeri Wordpress. Wp olanda super cache kurulu, sorun da çıkarmıyor zaten tek başına bu site. Toplam tekil hit günlük 20k'yı bulabiliyor.

    Bana önerebileceğiniz my.cnf ayarları nedir?
  • 10-05-2010, 02:42:47
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    mysql tuning script var onun verdiği sonuçlara göre ayar çekebilirsin. takıldığın yer olursa msndeyim yardım ederim
  • 10-05-2010, 02:50:35
    #3
    Üyeliği durduruldu
    tuning-primer.sh çektim sunucuya ve chmod atadıktan sonra çalıştırdım. 48 saat bekledikten sonra sonuçları görmek için tekrar mı çalıştırmam gerekiyor?
  • 10-05-2010, 02:56:13
    #4
    Üyeliği durduruldu
    litespeed kurmani öneririm.
    ayrica bu my.cnf sana uyanacağini saniyorum.
    Alıntı
    skip-locking # serverda sadece 1 MySQL varsa
    skip-name-resolve
    max_connections = 500 # cok yogun sitelerde bu deger arttirilabilir
    thread_cache_size = 128
    key_buffer = 128M
    query_cache_type = 1
    query_cache_size = 32M
    query_cache_limit = 4M
    table_cache = 2000 # cok fazla tablolu veritabanlarinda bu deger arttirilabilir
    low_priority_updates = 1
    ### innodb varsa asagidaki ayarlari aciniz
    #innodb_buffer_pool_size=256M
    #innodb_additional_mem_pool_size=64M
    #innodb_thread_concurrency=8
    #innodb_flush_method=O_DIRECT
    Alintidir.

    yapamadinsa pm at yardımcı olurum
  • 10-05-2010, 02:58:38
    #5
    swatemre adlı üyeden alıntı: mesajı görüntüle
    tuning-primer.sh çektim sunucuya ve chmod atadıktan sonra çalıştırdım. 48 saat bekledikten sonra sonuçları görmek için tekrar mı çalıştırmam gerekiyor?
    scripti çalıştırdığında Uptime = 3 days 18 hrs 27 min 41 sec gibi bir bölüm vardır onun sende en düşük 48 saat olması gerekiyor. öyleyse orda verdiği sonuçları şimdi kullanabilirsin
  • 10-05-2010, 03:02:10
    #6
    İki gün sonra tekrar çalıştırın tuning-primer'i.

    orada kırmızı renkte değişmesi önemli olan parametreler verilecek, onları verilen değerlere göre değiştirmeniz gerekiyor.
  • 12-05-2010, 14:00:29
    #7
    Üyeliği durduruldu
    3 gün boyunca çalıştı dosya. Sonuçlar böyle:

    Alıntı
    -- MYSQL PERFORMANCE TUNING PRIMER --
    - By: Matthew Montgomery -

    MySQL Version 5.0.90-community-log i686

    Uptime = 3 days 10 hrs 30 min 50 sec
    Avg. qps = 84
    Total Questions = 25072067
    Threads Connected = 17

    Server has been running for over 48hrs.
    It should be safe to follow these recommendations

    To find out more information on how each of these
    runtime variables effects performance visit:
    http://dev.mysql.com/doc/refman/5.0/...variables.html
    Visit http://www.mysql.com/products/enterprise/advisors.html
    for info about MySQL's Enterprise Monitoring and Advisory Service

    SLOW QUERIES
    The slow query log is NOT enabled.
    Current long_query_time = 10 sec.
    You have 620 out of 25072094 that take longer than 10 sec. to complete
    Your long_query_time seems to be fine

    BINARY UPDATE LOG
    The binary update log is enabled
    The expire_logs_days is not set.
    The mysqld will retain the entire binary log until RESET MASTER or PURGE MASTER LOGS commands are run manually
    Setting expire_logs_days will allow you to remove old binary logs automatically
    See http://dev.mysql.com/doc/refman/5.0/...ster-logs.html
    Binlog sync is not enabled, you could loose binlog records during a server crash

    WORKER THREADS
    Current thread_cache_size = 8
    Current threads_cached = 0
    Current threads_per_sec = 1
    Historic threads_per_sec = 0
    Your thread_cache_size is fine

    MAX CONNECTIONS
    Current max_connections = 100
    Current threads_connected = 20
    Historic max_used_connections = 101
    The number of used connections is 101% of the configured maximum.
    You should raise max_connections

    INNODB STATUS
    Current InnoDB index space = 0 bytes
    Current InnoDB data space = 0 bytes
    Current InnoDB buffer pool free = 96 %
    Current innodb_buffer_pool_size = 8 M
    Depending on how much space your innodb indexes take up it may be safe
    to increase this value to up to 2 / 3 of total system memory

    MEMORY USAGE
    Max Memory Ever Allocated : 1.44 G
    Configured Max Per-thread Buffers : 1.20 G
    Configured Max Global Buffers : 234 M
    Configured Max Memory Limit : 1.43 G
    Physical Memory : 2.00 G
    Max memory limit seem to be within acceptable norms

    KEY BUFFER
    Current MyISAM index space = 242 M
    Current key_buffer_size = 96 M
    Key cache miss rate is 1 : 9915
    Key buffer free ratio = 25 %
    Your key_buffer_size seems to be too high.
    Perhaps you can use these resources elsewhere

    QUERY CACHE
    Query cache is enabled
    Current query_cache_size = 128 M
    Current query_cache_used = 73 M
    Current query_cache_limit = 2 M
    Current Query cache Memory fill ratio = 57.46 %
    Current query_cache_min_res_unit = 4 K
    MySQL won't cache query results that are larger than query_cache_limit in size

    SORT OPERATIONS
    Current sort_buffer_size = 2 M
    Current read_rnd_buffer_size = 8 M
    Sort buffer seems to be fine

    JOINS
    Current join_buffer_size = 132.00 K
    You have had 7431 queries where a join could not use an index properly
    You should enable "log-queries-not-using-indexes"
    Then look for non indexed joins in the slow query log.
    If you are unable to optimize your queries you may want to increase your
    join_buffer_size to accommodate larger joins in one pass.

    Note! This script will still suggest raising the join_buffer_size when
    ANY joins not using indexes are found.

    OPEN FILES LIMIT
    Current open_files_limit = 2158 files
    The open_files_limit should typically be set to at least 2x-3x
    that of table_cache if you have heavy MyISAM usage.
    Your open_files_limit value seems to be fine

    TABLE CACHE
    Current table_cache value = 1024 tables
    You have a total of 164 tables
    You have 989 open tables.
    Current table_cache hit rate is 29%
    , while 96% of your table cache is in use
    You should probably increase your table_cache

    TEMP TABLES
    Current max_heap_table_size = 16 M
    Current tmp_table_size = 32 M
    Of 313761 temp tables, 45% were created on disk
    Effective in-memory tmp_table_size is limited to max_heap_table_size.
    Perhaps you should increase your tmp_table_size and/or max_heap_table_size
    to reduce the number of disk-based temporary tables
    Note! BLOB and TEXT columns are not allow in memory tables.
    If you are using these columns raising these values might not impact your
    ratio of on disk temp tables.

    TABLE SCANS
    Current read_buffer_size = 2 M
    Current table scan ratio = 376 : 1
    read_buffer_size seems to be fine

    TABLE LOCKING
    Current Lock Wait ratio = 1 : 149
    You may benefit from selective use of InnoDB.
    If you have long running SELECT's against MyISAM tables and perform
    frequent updates consider setting 'low_priority_updates=1'
    If you have a high concurrency of inserts on Dynamic row-length tables
    consider setting 'concurrent_insert=2'.
    Nasıl bir my.cnf çıkar bu sonuçlardan?
  • 15-05-2010, 08:44:58
    #8
    Üyeliği durduruldu
    swatemre adlı üyeden alıntı: mesajı görüntüle
    Merhaba arkadaşlar, VPS sunucumda uzun zamandır aşırı MySQL kullanımı olduğundan sık sık kesinti oluyor. Özellikle hafta sonları MySQL kullanımı %100'lere kadar çıkıyor ve haliyle VPS kapatılıyor. Hostcu sunucu kaynaklı bir durum olmadığını ve optimize yaptırmam gerektiğini söylüyor. Bu konuda hiçbir fikrim olmadığından sizlerden yardım istemeye karar verdim.

    Sunucu özellikleri:



    Ram bilgileri:



    Apache 2.2.15, PHP 5.3.2 ve MySQL 5.0.90 kullanıyorum. Şuanki my.cnf dosyası boş. Sitelere gelirsek; biri SMF tabanlı forum ve diğeri Wordpress. Wp olanda super cache kurulu, sorun da çıkarmıyor zaten tek başına bu site. Toplam tekil hit günlük 20k'yı bulabiliyor.

    Bana önerebileceğiniz my.cnf ayarları nedir?
    Msn adresim omer@turkalb.com eklersen sana özel ücretsiz optimize yapabilirim.