• 09-06-2010, 16:06:03
    #1
    Merhabalar,

    Konu hakkında uzman kişilerin olduğunu düşünerek buraya bu başlığı açmayı uygun gördüm. Bir tane site çalıştıran bir sunucum var. Sitenin günlük tekil hit 60K - 70K civarı. Sitenin mysql kullanımı hep yüksek. Top ile baktığımda %300lerde. Sunucunun loadı 3-4 civarında.

    Sunucunun özellikleri:
    İşlemci: Intel Xeon E5504
    Ram: 4 GB
    HDD: 250 GB 7.2K Sata II

    Sorunun diskten olduğunu düşünmekteyim. Fakat aklına başka bir fikir gelen olur mu diye soruyorum. Yoksa 600 dolar verip sas diskleri alıp raid yapacağım.

    Teşekkürler
  • 09-06-2010, 16:12:06
    #2
    mysql optimize yaptınız mı?

    diğer bir seçenek olarak mysql için ayrı bir sunucu alıp o kullanılabilir,

    deneyebileceğiniz bir diğer seçenek nginx i proxy modu ile kurup en azından statik dosyaların (css, js, jpg, gif vs.) apache üstündeki yükünü hafifletebilirsiniz.
  • 09-06-2010, 16:17:53
    #3
    MySQL optimizasyonunu yaptım. Ama akşam tekrar optimizasyon yapacağım. Sonucu bildireceğim.
  • 10-06-2010, 11:36:28
    #4
    Tuning Primer Sonucu

    Alıntı
    SLOW QUERIES
    The slow query log is enabled.
    Current long_query_time = 3 sec.
    You have 19 out of 4001623 that take longer than 3 sec. to complete
    Your long_query_time seems to be fine

    BINARY UPDATE LOG
    The binary update log is NOT enabled.
    You will not be able to do point in time recovery
    See http://dev.mysql.com/doc/refman/5.0/...-recovery.html

    WORKER THREADS
    Current thread_cache_size = 64
    Current threads_cached = 60
    Current threads_per_sec = 0
    Historic threads_per_sec = 0
    Your thread_cache_size is fine

    MAX CONNECTIONS
    Current max_connections = 500
    Current threads_connected = 4
    Historic max_used_connections = 110
    The number of used connections is 22% of the configured maximum.
    Your max_connections variable seems to be fine.

    INNODB STATUS
    Current InnoDB index space = 2 M
    Current InnoDB data space = 2 M
    Current InnoDB buffer pool free = 38 %
    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 : 683 M
    Configured Max Per-thread Buffers : 2.56 G
    Configured Max Global Buffers : 106 M
    Configured Max Memory Limit : 2.66 G
    Physical Memory : 5.81 G
    Max memory limit seem to be within acceptable norms

    KEY BUFFER
    Current MyISAM index space = 8 M
    Current key_buffer_size = 64 M
    Key cache miss rate is 1 : 92744
    Key buffer free ratio = 79 %
    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 = 32 M
    Current query_cache_used = 19 M
    Current query_cache_limit = 2 M
    Current Query cache Memory fill ratio = 61.81 %
    Current query_cache_min_res_unit = 4 K
    Query Cache is 21 % fragmented
    Run "FLUSH QUERY CACHE" periodically to defragment the query cache memory
    If you have many small queries lower 'query_cache_min_res_unit' to reduce fragmentation.
    MySQL won't cache query results that are larger than query_cache_limit in size

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

    JOINS
    Current join_buffer_size = 2.00 M
    You have had 533 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 = 2500 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 = 850 tables
    You have a total of 428 tables
    You have 729 open tables.
    The table_cache value seems to be fine

    TEMP TABLES
    Current max_heap_table_size = 16 M
    Current tmp_table_size = 32 M
    Of 9269 temp tables, 3% were created on disk
    Effective in-memory tmp_table_size is limited to max_heap_table_size.
    Created disk tmp tables ratio seems fine

    TABLE SCANS
    Current read_buffer_size = 1 M
    Current table scan ratio = 12985 : 1
    You have a high ratio of sequential access requests to SELECTs
    You may benefit from raising read_buffer_size and/or improving your use of indexes.

    TABLE LOCKING
    Current Lock Wait ratio = 1 : 59
    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'.
    my.cnf

    Alıntı
    [mysqld]
    set-variable=local-infile=0
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1
    log-slow-queries = /var/log/mysql-slow.log
    long_query_time = 3
    query_cache_limit=2M
    query_cache_size=32M
    query_cache_type=1
    max_user_connections=300
    max_connections=500
    interactive_timeout=10
    wait_timeout=15
    connect_timeout=20
    thread_cache_size=64
    key_buffer=32M
    join_buffer=2M
    max_connect_errors=15
    max_allowed_packet=32M
    table_cache=850
    record_buffer=1M
    sort_buffer_size=1M
    read_buffer_size=1M
    read_rnd_buffer_size=1M
    thread_concurrency=2
    myisam_sort_buffer_size=2M

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    Şu anda top üzerinden baktığımda mysqld %36 civarında götürüyor. Yoğun saatlerde bu %300leri aşıyor.

    4 GB ram 60K - 70K tekil hitli bir site için yeterli midir?
  • 10-06-2010, 11:39:30
    #5
    litespeedin trial sürümünü kurup bi onunla 2 gün denermisin ?
  • 10-06-2010, 15:18:04
    #6
    Kullandığın sistem cacheleme özelliğine sahipmi ?