• 06-10-2008, 01:42:52
    #1
    Üyeliği durduruldu
    P4 3.2 ghz
    2 gb ram

    gibi bi sisteme nasıl bi my.cnf ayarı yapılır >
  • 06-10-2008, 10:36:55
    #2
    Administrator
    Makina özelliklerine göre my.cnf yazarım fakat sağlıklı olmaz. çünkü
    MySQL kullanım yogunlugu yaratılan indexlerin yetip yetmediği uzun süren sorgular vb. gibi bir çok fonksiyonlardan etkilenen ince ayar gerektiren bir veritabanı.

    Öncelikle MySQL sunucunuzu minimum 2 gün ( 48 saat ) çalıştırın huyunu suyunu kavrasın makina

    daha sonra

    Kurulum:

    SSH root olarak giriş yapın ve aşağıdaki komutu yazın,


    wget http://day32.com/MySQL/tuning-primer.sh
    Ardından CHMOD düzenleyin


    chmod 775 tuning-primer.sh
    MYSQL durum sınaması için yapmamız gereken ,



    ./tuning-primer.sh
    Çalıştırın ve Çıkanları buraya yapıştırın. böylece Kullanımınıza göre güzel bir ayar verebilirim.
  • 10-10-2008, 14:35:47
    #3
    Üyeliği durduruldu
    [mysqld]
    old_passwords=1
    skip-bdb
    safe-show-database
    innodb_data_file_path=ibdata1:10M:autoextend
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    table_cache = 1024
    max_connections = 1000
    query-cache-type = 1
    query-cache-size = 32M
    max_allowed_packet=64M
    safe-show-database
    set-variable=local-infile=0
    max_allowed_packet = 32M
    [mysql.server]
    user=mysql
    basedir=/var/lib

    böyle bi ayar sisteminize uyar...
  • 11-10-2008, 03:21:02
    #4
    Administrator
    sisteminde kac adet mysql in ne kadar sıklıkla calıştıgı ne kadar buffer a ne kadar belleğe ve ne kadar index e ihtiyaci olduğunu nerden biliyorsunuz ?

    O yüzden Lütfen hazır conf lar vermeyin Mysql tuning script 'ini Çalıştırıp sisteminize uygun olan cnf ları üretin.
  • 14-10-2008, 12:52:11
    #5
    Üyeliği durduruldu
    -- MYSQL PERFORMANCE TUNING PRIMER --
    - By: Matthew Montgomery -

    MySQL Version 4.1.20 i686

    Uptime = 3 days 18 hrs 27 min 41 sec
    Avg. qps = 4
    Total Questions = 1416598
    Threads Connected = 1

    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 3.23, 4.0, 4.1 Reference Manual :: 5.1.3 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 2 out of 1416612 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 3.23, 4.0, 4.1 Reference Manual :: 6.3 Point-in-Time Recovery

    WORKER THREADS
    Current thread_cache_size = 0
    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 = 1000
    Current threads_connected = 1
    Historic max_used_connections = 11
    The number of used connections is 1% of the configured maximum.
    You are using less than 10% of your configured max_connections.
    Lowering max_connections could help to avoid an over-allocation of memory
    See "MEMORY USAGE" section to make sure you are not over-allocating

    MEMORY USAGE
    Max Memory Ever Allocated : 79 M
    Configured Max Per-thread Buffers : 2 G
    Configured Max Global Buffers : 49 M
    Configured Max Memory Limit : 2 G
    Physical Memory : 1.97 G

    Max memory limit exceeds 90% of physical memory

    KEY BUFFER
    Current MyISAM index space = 830 M
    Current key_buffer_size = 7 M
    Key cache miss rate is 1 : 15
    Key buffer fill ratio = 99.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 = 32 M
    Current query_cache_used = 27 M
    Current query_cache_limit = 1 M
    Current Query cache Memory fill ratio = 86.10 %
    Current query_cache_min_res_unit = 4 K
    However, 49591 queries have been removed from the query cache due to lack of memory
    Perhaps you should raise query_cache_size
    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 = 132.00 K
    You have had 29 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 = 5010 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 1855 tables
    You have 1024 open tables.
    Current table_cache hit rate is 11%, 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 39500 temp tables, 9% 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 = 128 K
    Current table scan ratio = 2295 : 1
    read_buffer_size seems to be fine

    TABLE LOCKING
    Current Lock Wait ratio = 1 : 501
    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'
  • 14-10-2008, 12:56:17
    #6
    Üyeliği durduruldu
    top yazdığımda böyle gösterio yukarıdaki bilgiler

    Mem: 2067104k total, 1937456k used, 129648k free, 68864k buffers
    Swap: 4128696k total, 6004k used, 4122692k free, 1336804k cached
  • 14-10-2008, 13:30:03
    #7
    Kimlik doğrulama veya yönetimden onay bekliyor.
    [root@server ~]# ./tuning-primer.sh
    mysqld is alive

    -- MYSQL PERFORMANCE TUNING PRIMER --
    - By: Matthew Montgomery -

    MySQL Version 5.0.51a-community-log x86_64

    Uptime = 0 days 10 hrs 49 min 56 sec
    Avg. qps = 66
    Total Questions = 2611928
    Threads Connected = 6

    Warning: Server has not been running for at least 48hrs.
    It may not be safe to use 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 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 46 out of 2611957 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 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 MySQL :: MySQL 5.0 Reference Manual :: 12.6.1.1 PURGE MASTER LOGS Syntax

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

    MAX CONNECTIONS
    Current max_connections = 100
    Current threads_connected = 8
    Historic max_used_connections = 47
    The number of used connections is 47% of the configured maximum.
    Your max_connections variable seems to be fine.

    MEMORY USAGE
    Max Memory Ever Allocated : 1008 M
    Configured Max Per-thread Buffers : 1 G
    Configured Max Global Buffers : 426 M
    Configured Max Memory Limit : 1 G
    Physical Memory : 3.84 G
    Max memory limit seem to be within acceptable norms

    KEY BUFFER
    Current MyISAM index space = 475 M
    Current key_buffer_size = 384 M
    Key cache miss rate is 1 : 1453
    Key buffer fill ratio = 9.00 %
    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 = 27 M
    Current query_cache_limit = 1 M
    Current Query cache Memory fill ratio = 85.46 %
    Current query_cache_min_res_unit = 4 K
    However, 269286 queries have been removed from the query cache due to lack of memory
    Perhaps you should raise query_cache_size
    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 = 7 M
    Sort buffer seems to be fine

    JOINS
    Current join_buffer_size = 132.00 K
    You have had 822 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 = 1134 files
    The open_files_limit should typically be set to at least 2x-3x
    that of table_cache if you have heavy MyISAM usage.
    You currently have open more than 75% of your open_files_limit
    You should set a higher value for open_files_limit in my.cnf

    TABLE CACHE
    Current table_cache value = 512 tables
    You have a total of 5249 tables
    You have 512 open tables.
    Current table_cache hit rate is 2%, 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 92921 temp tables, 33% 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 = 1 M
    Current table scan ratio = 832 : 1
    read_buffer_size seems to be fine

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


    bende cıkan sonuc budur bazı yerlerde sorun var sanırım
  • 14-10-2008, 13:45:29
    #8
    Üyeliği durduruldu
    bilgiislem yeni konu açmayı denesen
  • 14-10-2008, 14:00:18
    #9
    sizin için my.cnf ayarı
    Alıntı
    [mysqld]
    set-variable=local-infile=0
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    old_passwords=1
    innodb_data_file_path=ibdata1:10M:autoextend

    skip-bdb
    skip-networking

    log-bin

    expire_logs_days = 2
    thread_cache_size = 384
    max_connections = 130
    query_cache_size = 32M
    query_cache_type = 1
    sort_buffer_size = 2M
    read_buffer_size = 2M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    long_query_time = 4
    key_buffer_size = 1024M
    join_buffer_size = 2m
    table_cache = 1024
    low_priority_updates = 1
    tmp_table_size = 1M
    max_heap_table_size = 1M

    [safe_mysqld]
    open_files_limit=5192


    [mysql.server]
    user=mysql
    basedir=/var/lib

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
    Marty_Mcfly adlı üyeden alıntı: mesajı görüntüle
    -- MYSQL PERFORMANCE TUNING PRIMER --
    - By: Matthew Montgomery -

    MySQL Version 4.1.20 i686

    Uptime = 3 days 18 hrs 27 min 41 sec
    Avg. qps = 4
    Total Questions = 1416598
    Threads Connected = 1

    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 3.23, 4.0, 4.1 Reference Manual :: 5.1.3 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 2 out of 1416612 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 3.23, 4.0, 4.1 Reference Manual :: 6.3 Point-in-Time Recovery

    WORKER THREADS
    Current thread_cache_size = 0
    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 = 1000
    Current threads_connected = 1
    Historic max_used_connections = 11
    The number of used connections is 1% of the configured maximum.
    You are using less than 10% of your configured max_connections.
    Lowering max_connections could help to avoid an over-allocation of memory
    See "MEMORY USAGE" section to make sure you are not over-allocating

    MEMORY USAGE
    Max Memory Ever Allocated : 79 M
    Configured Max Per-thread Buffers : 2 G
    Configured Max Global Buffers : 49 M
    Configured Max Memory Limit : 2 G
    Physical Memory : 1.97 G

    Max memory limit exceeds 90% of physical memory

    KEY BUFFER
    Current MyISAM index space = 830 M
    Current key_buffer_size = 7 M
    Key cache miss rate is 1 : 15
    Key buffer fill ratio = 99.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 = 32 M
    Current query_cache_used = 27 M
    Current query_cache_limit = 1 M
    Current Query cache Memory fill ratio = 86.10 %
    Current query_cache_min_res_unit = 4 K
    However, 49591 queries have been removed from the query cache due to lack of memory
    Perhaps you should raise query_cache_size
    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 = 132.00 K
    You have had 29 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 = 5010 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 1855 tables
    You have 1024 open tables.
    Current table_cache hit rate is 11%, 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 39500 temp tables, 9% 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 = 128 K
    Current table scan ratio = 2295 : 1
    read_buffer_size seems to be fine

    TABLE LOCKING
    Current Lock Wait ratio = 1 : 501
    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'