• 09-03-2009, 20:53:13
    #1
    Serverın aşırı kasıldığı zamanlar ile ilgili genel bilgiler şöyle
    Vbulletin forumlarda 1 saat cookie süresi ile ortalama online sayıları şöyle
    8000
    2500
    1500
    1500
    1500
    250
    Bunlar dışında 4-5 tane ortalama 5 k hitli wordpress var
    Server load öğle saatlerinde 30 - 70 arası değişiyor.
    Sunucu özellikleri
    Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz
    8 gb ram
    2 x 500 hdd
    Cpanel

    Vbulletinler xcache kurulu ve vbseo panelinde xcache işaretli hepsinde.
    top çıktısı şuan böyle, belki yardımı olur.
    Alıntı
    3803 mysql 15 0 948m 545m 4872 D 312.6 7.0 29071:48 mysqld
    14763 nobody 15 0 410m 38m 30m S 8.7 0.5 0:04.10 httpd
    14767 nobody 17 0 415m 36m 21m S 8.0 0.5 0:02.44 httpd
    14818 nobody 15 0 411m 29m 17m S 7.1 0.4 0:02.76 httpd
    14868 nobody 15 0 408m 26m 18m S 5.8 0.3 0:02.17 httpd
    14747 nobody 15 0 408m 36m 28m S 5.5 0.5 0:03.27 httpd
    14873 nobody 15 0 408m 32m 24m S 3.2 0.4 0:04.19 httpd
    14902 nobody 16 0 410m 26m 17m R 3.2 0.3 0:01.83 httpd
    14968 nobody 15 0 408m 26m 17m S 3.2 0.3 0:01.66 httpd
    15209 nobody 16 0 410m 30m 19m R 2.9 0.4 0:01.37 httpd
    14784 nobody 15 0 408m 21m 13m S 2.2 0.3 0:01.61 httpd
    14847 nobody 15 0 408m 34m 26m S 2.2 0.4 0:03.28 httpd
    14781 nobody 15 0 408m 25m 17m S 1.9 0.3 0:01.84 httpd
    tuning primer çıktısı şöyle
    Alıntı
    -- MYSQL PERFORMANCE TUNING PRIMER --
    - By: Matthew Montgomery -
    MySQL Version 5.0.67-community i686
    Uptime = 17 days 2 hrs 4 min 35 sec
    Avg. qps = 114
    Total Questions = 169267385
    Threads Connected = 156
    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:
    MySQL :: MySQL 5.0 Reference Manual :: 5.1.3 Server System Variables
    Visit MySQL :: MySQL Enterprise Advisors
    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 80857 out of 169268325 that take longer than 10 sec. to complete
    Your long_query_time may be too high, I typically set this under 5 sec.
    BINARY UPDATE LOG
    The binary update log is NOT enabled.
    You will not be able to do point in time recovery
    See MySQL :: MySQL 5.0 Reference Manual :: 6.3 Point-in-Time Recovery
    WORKER THREADS
    Current thread_cache_size = 128
    Current threads_cached = 72
    Current threads_per_sec = 0
    Historic threads_per_sec = 0
    Your thread_cache_size is fine
    MAX CONNECTIONS
    Current max_connections = 1000
    Current threads_connected = 162
    Historic max_used_connections = 377
    The number of used connections is 37% of the configured maximum.
    Your max_connections variable seems to be fine.
    MEMORY USAGE
    Max Memory Ever Allocated : 2 G
    Configured Max Per-thread Buffers : 5 G
    Configured Max Global Buffers : 282 M
    Configured Max Memory Limit : 5 G
    Physical Memory : 7.63 G
    Max memory limit seem to be within acceptable norms
    KEY BUFFER
    Current MyISAM index space = 1 G
    Current key_buffer_size = 16 M
    Key cache miss rate is 1 : 271
    Key buffer fill ratio = 100.00 %
    You could increase key_buffer_size
    It is safe to raise this up to 1/4 of total system memory;
    assuming this is a dedicated database server.
    QUERY CACHE
    Query cache is enabled
    Current query_cache_size = 256 M
    Current query_cache_used = 159 M
    Current query_cache_limit = 8 M
    Current Query cache Memory fill ratio = 62.36 %
    Current query_cache_min_res_unit = 4 K
    Query Cache is 23 % 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 = 2 M
    Current read_rnd_buffer_size = 256 K
    Sort buffer seems to be fine
    JOINS
    Current join_buffer_size = 1.00 M
    You have had 77812 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 = 5000 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 2193 tables
    You have 1024 open tables.
    Current table_cache hit rate is 0%, while 100% 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 2689059 temp tables, 44% 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 = 29 : 1
    read_buffer_size seems to be fine
    TABLE LOCKING
    Current Lock Wait ratio = 1 : 45
    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'.
    Mesela şuan en aşırı an olmasada yoğun bi zaman şu şekilde
    Alıntı
    Server Load 48.71 (4 cpus)
    Memory Used 33.5 %
    my.cnf şöyle
    Alıntı
    set-variable = max_connections=500
    safe-show-database
    query_cache_limit=8M
    query_cache_size=256M
    query_cache_type=1
    max_connections=1000
    interactive_timeout=20
    wait_timeout=20
    connect_timeout=6
    thread_cache_size=128
    key_buffer=16M
    join_buffer=1M
    max_allowed_packet=16M
    table_cache=1024
    record_buffer=1M
    sort_buffer_size=2M
    read_buffer_size=2M
    max_connect_errors=10
    httpd.conf ise şu şekilde
    Alıntı
    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 0
    KeepAliveTimeout 1
    MinSpareServers 16
    MaxSpareServers 64
    StartServers 16
    MaxClients 512
    MaxRequestsPerChild 1000000
    User nobody
    Group nobody
    ExtendedStatus On
    Sunucumda optimizasyon konusunda neler yapabilirim ? Şuan daha düzgün çalışacak hale getirebilirmiyim yoksa yeni bir sunucu dahamı lazım bana ?
  • 09-03-2009, 20:54:50
    #2
    httpd.conf

    Timeout 45
    KeepAlive Off


    değiştir bir nevi düşer birazda olsa
  • 10-03-2009, 00:58:36
    #3
    mow
    Üyeliği durduruldu
    Aman diyeyim keepalive ı kapatma

    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 0
    KeepAliveTimeout 35
    MinSpareServers 10
    MaxSpareServers 50
    StartServers 10
    MaxClients 256
    MaxRequestsPerChild 5000
    User nobody
    Group nobody
    ExtendedStatus Off
  • 10-03-2009, 11:51:45
    #4
    mow adlı üyeden alıntı: mesajı görüntüle
    Aman diyeyim keepalive ı kapatma
    Timeout 300
    KeepAlive On
    MaxKeepAliveRequests 0
    KeepAliveTimeout 35
    MinSpareServers 10
    MaxSpareServers 50
    StartServers 10
    MaxClients 256
    MaxRequestsPerChild 5000
    User nobody
    Group nobody
    ExtendedStatus Off
    bu ayarlar daha fazla kastı
  • 10-03-2009, 12:33:35
    #5
    mow
    Üyeliği durduruldu
    Bir reçetesi elbette yok ancak şuna dikkat etmelisin eğer bu ayarlarla sitende normalden daha fazla kişi online olmuş ise ayarları başarılı kabul etmen gerekir, kasacak artık yapılacak bir şey yok diyebilirsin ama tam tersine online sayın azaldı veya aynı kaldı ise yanlış olmuş demektir, böyleyse tekrar deneyelim;

    Timeout 300 # eğer upload varsa böyle kalsın yoksa 30 a düşür
    KeepAlive On # kesin böyle
    MaxKeepAliveRequests 0 # kesin böyle
    KeepAliveTimeout 35 #kesin böyle
    MinSpareServers 10
    MaxSpareServers 60
    StartServers 10
    MaxClients 300
    MaxRequestsPerChild 10000
    User nobody
    Group nobody
    ExtendedStatus Off #kesin böyle

    Unutma ki http sunucun ne kadar optimize olursa o kadar fazla istek/ziyaretçi alırsın -> çok ziyaretçi aldığında mysql de çok çalışır -> mysql daha çok çalıştığından sunucun elbette kasar. Bunları gözlemlemen ona göre hareket etmen gerekli.