R10.net

R10.net (https://www.r10.net/index.php)
-   Server Optimizasyon (https://www.r10.net/server-optimizasyon/)
-   -   httpd.conf ve my.conf optimizasyon (https://www.r10.net/server-optimizasyon/239736-httpd-conf-ve-my-conf-optimizasyon.html)

matrix 28-09-2008 17:44:44

httpd.conf ve my.conf optimizasyon
 
Merhaba,
Dual xeon 2.8 işlemci, 2gb ram sunucuyu günlük yaklaşık 50000 ziyaretçiyi sorunsuz şekilde kaldıracak şekilde nasıl optimize etmek lazım?

Sayfalar veriyi mysqlden çekiyor, genelde txt ağırlıklı ama tasarım vs den kaynaklanan resim sayısı da az sayılmaz.

httpd.conf ve my.conf dosyalarında ne gibi değişiklikler yapmalıyım? bunlar dışında sunucu performansını arttırmak ve sunucunun çökmesini engellemek için neler yapabilirim?

Teşekkürler.

Coşkun Çetin 06-10-2008 10:38:50

50K ve üstü için tabi ki Cluster yapmayı öneririm

Hit artınca MySQL ve Apache veya bir başka webserverın birlikde çalışması makinayı kastırabiliyor güzel bir optimasyonla bir nebze önlem almış olursunuz.

50K ya yada 100K ya göre my.cnf vermek heralde loto oynamak gibi bişey olur. Çünkü
MySQL 'i Kullanan scriptler vBulletin, Smf vb. 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,


Ardından CHMOD düzenleyin


Kod:

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



Kod:

./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.

matrix 06-10-2008 21:48:17

Cevap için teşekkürler.
Cluster yapma imkanım maalesef yok şuan için. Sunuc tahmin ettiğim gibi siteyi taşıyınca problem çıkarmaya başladı. Top komutunda mysql kullanımı ortalama %60 gibi fakat bazen %100ü aşıyor. Ram kullanımı 1gb civarında boşta 1 gb ram var.
Siteler arada çok çok yavaşlıyor ve daha sonra açılmamaya başlıyor. İşin ilginci ben whm paneli kullanmaya devam edebiliyorum. Ordan httpd restart yapınca sunucu kendine geliyor ve 10 dk sonra tekrar siteler ya tam açılmıyor ya da çok geç açılıyor.
Mysql'e ssh ile bağlantı kurmada vs de bir sorun yok. Hatta uzak mysql management programları ile mysql yönetmeye devam edebiliyorum sitelere ulaşılamadığı zaman.
Önermiş olduğunuz scripti çalıştırdım sonuç aşağıda:
Kod:

mysqld is alive
        -- MYSQL PERFORMANCE TUNING PRIMER --
            - By: Matthew Montgomery -
MySQL Version 5.0.51a-community i686
Uptime = 8 days 23 hrs 30 min 44 sec
Avg. qps = 31
Total Questions = 24767892
Threads Connected = 7
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/en/server-system-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 8 out of 24767921 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 http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html
WORKER THREADS
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 3
Historic threads_per_sec = 1
Threads created per/sec are overrunning threads cached
You should raise thread_cache_size
MAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 7
Historic max_used_connections = 66
The number of used connections is 66% of the configured maximum.
Your max_connections variable seems to be fine.
MEMORY USAGE
Max Memory Ever Allocated : 195 M
Configured Max Per-thread Buffers : 268 M
Configured Max Global Buffers : 17 M
Configured Max Memory Limit : 286 M
Physical Memory : 1.97 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 17 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 3155
Key buffer fill ratio = 54.00 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_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 634 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 = 1024 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 = 64 tables
You have a total of 326 tables
You have 64 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 5491605 temp tables, 7% 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 = 26 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 533
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'.


Coşkun Çetin 07-10-2008 09:14:02

Şuanda Kullandığınız my.cnf uda koyarmısınız

cat /etc/my.cnf

matrix 07-10-2008 09:28:34

Şuan kullanılan my.cnf dosyasında sadace şu satırlar var;
Kod:

[mysqld]
set-variable = max_connections=500
safe-show-database

Ayrıca dün apache error logları inceledim ve tıkanmanın olduğu zamanlarda sunucunun
"[error] server reached MaxClients setting, consider raising the MaxClients setting"
şeklinde hatalar verdiğini farkettim. Bunun üzerine httpd.conf dosyasını şu şekilde yeniden düzenledim.

Kod:

Timeout 20

<IfModule prefork.c>
    StartServers 10
    MinSpareServers 30
    MaxSpareServers 50
    ServerLimit 256
    MaxClients 200
    MaxRequestsPerChild 1000
</IfModule>

Henüz sabah olduğu için sitelerde trafik yok, o yüzden test edemedim sorunu çözüp çözmediğini. Sizce MaxClients değerini yükseltmek çözüm olabilir mi? Daha başka ne yapabilirim?

Teşekkürler yardımlar için..

Coşkun Çetin 07-10-2008 09:47:16

Önce my.cnf 'u ayarlayıp durumu kontrol edlim 1-2 gün mysql 'u takip edin performans ve daha az cpu kullanması açısından.

bunları my.cnf olarak Kullanın 2 gün kontrol edin ve tekrar o script 'i calıştırıp çıktıları buraya yapıştırın.

Kod:

[mysqld]
skip-name-resolve
local-infile=0
safe-show-database
back_log = 50
skip-innodb
max_connections = 200
long_query_time = 4
key_buffer = 128M
max_allowed_packet = 30M
myisam_sort_buffer_size = 64M
table_cache = 400
tmp_table_size = 128M
query_cache_type = 1
query_cache_size = 7M
query_cache_limit = 6M
query_prealloc_size = 262144
query_alloc_block_size = 65536
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
max_write_lock_count = 16
thread_cache_size = 128
log-queries-not-using-indexes
join_buffer_size = 3M
read_buffer_size = 2M
sort_buffer_size = 2M
read_rnd_buffer_size = 256K
wait_timeout = 30
connect_timeout = 30
interactive_timeout= 30
table_lock_wait_timeout = 30
old-passwords = 1
low_priority_updates = 1
concurrent_insert=2
default-storage-engine = MyISAM


#required unique id between 1 and 2^32 - 1
server-id      = 1


[mysql]
no-auto-rehash


[mysqldump]
quick
quote-names
max_allowed_packet = 1000M


[myisamchk]
tmpdir=/temp
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 16M
write_buffer = 16M


[mysqlhotcopy]
interactive-timeout


matrix 07-10-2008 10:10:19

Teşekkürler, 2 gün sonra yeni durum hakkında bilgi veririm.

Coşkun Çetin 09-10-2008 09:05:25

Son durum nedir. ?

matrix 10-10-2008 09:50:59

Merhaba,
httpd.conf dosyasını eski haline alıp mysql değişikliklerini yaptım fakat aynı gün içinde tekrar kapanmalar olunca log dosyasını incelediğimde yine max client error verdiğini gördüm.
Bunun üzerine httpd.conf dosyasını
Kod:

Timeout 20
<IfModule prefork.c>
    StartServers 10
    MinSpareServers 30
    MaxSpareServers 50
    ServerLimit 256
    MaxClients 200
    MaxRequestsPerChild 1000
</IfModule>

şeklinde ayarladım.
My.cnf dosyasını httpd.conf dosyasını test edebilmek için pek değiştirmedim sadece şu bi kaç satırı ekledim;
Kod:

[mysqld]
set-variable = max_connections=500
safe-show-database
table_cache = 340
query_cache_size = 8M
thread_cache_size = 4

İki gündür kapanmadı neyseki. Load değerleri 1-2 civarında geziniyor en yoğun zamanlarda. Max client error hatasıda artık yok.
Yeni mysql raporu şu şekilde;
Kod:

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/en/server-system-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 1 out of 13390150 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 http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html
WORKER THREADS
Current thread_cache_size = 4
Current threads_cached = 3
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 = 1
Historic max_used_connections = 34
The number of used connections is 6% 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 : 117 M
Configured Max Per-thread Buffers : 1 G
Configured Max Global Buffers : 25 M
Configured Max Memory Limit : 1 G
Physical Memory : 1.97 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 17 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 8664
Key buffer fill ratio = 62.00 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 8 M
Current query_cache_used = 4 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 53.89 %
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 = 256 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 132.00 K
You have had 170 queries where a join could not use an index properly
You have had 1 joins without keys that check for key usage after each row
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 = 340 tables
You have a total of 326 tables
You have 340 open tables.
Current table_cache hit rate is 21%, 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 1541315 temp tables, 20% 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 = 1204 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 96
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'.


Coşkun Çetin 10-10-2008 11:30:40

Max client hatası Apache ile ilgili Saldırı olduğu anda değerden fazla client bağlanmaya Çalıştığında veriyordur. Max Client servera göre arttırılabilir.

MySQL de bunlarıda ekleyip restartla

query_cache_limit = 6M
long_query_time = 4

x1y2 08-11-2008 23:32:52

root@Linux [~]# ./tuning-primer.sh
mysqld is alive

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

MySQL Version 5.0.51a-community i686

Uptime = 0 days 8 hrs 51 min 41 sec
Avg. qps = 289
Total Questions = 9236641
Threads Connected = 2

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 0 out of 9236742 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 = 0
Current threads_cached = 0
Current threads_per_sec = 11
Historic threads_per_sec = 7
Threads created per/sec are overrunning threads cached
You should raise thread_cache_size
MAX CONNECTIONS
Current max_connections = 2048
Current threads_connected = 1
Historic max_used_connections = 24
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 : 82 M
Configured Max Per-thread Buffers : 5 G
Configured Max Global Buffers : 17 M
Configured Max Memory Limit : 5 G
Physical Memory : 7.92 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 105 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 42
Key buffer fill ratio = 42.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere

QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_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 3128 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 = 10240 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 = 64 tables
You have a total of 1038 tables
You have 64 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 110436 temp tables, 0% 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 = 776 : 1
read_buffer_size seems to be fine

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


bu scripti çaliştirdiğimda çikan sonuç budur buna göre bir my.cnf alabilirmiyim bazen load seviyelerim çok artiyor ve top -c çektiğimde mysql kullanimim % 100 % 200 olabiliyor Quad core 2.4 9500 işlemcim ve 8 gb ram var şimdiden teşekkürler

Coşkun Çetin 10-11-2008 10:16:40

Alıntı:

x1y2 Nickli Üyeden Alıntı (Mesaj 2739223)
root@Linux [~]# ./tuning-primer.sh
mysqld is alive

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

MySQL Version 5.0.51a-community i686

Uptime = 0 days 8 hrs 51 min 41 sec
Avg. qps = 289
Total Questions = 9236641
Threads Connected = 2

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 0 out of 9236742 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 = 0
Current threads_cached = 0
Current threads_per_sec = 11
Historic threads_per_sec = 7
Threads created per/sec are overrunning threads cached
You should raise thread_cache_size
MAX CONNECTIONS
Current max_connections = 2048
Current threads_connected = 1
Historic max_used_connections = 24
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 : 82 M
Configured Max Per-thread Buffers : 5 G
Configured Max Global Buffers : 17 M
Configured Max Memory Limit : 5 G
Physical Memory : 7.92 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 105 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 42
Key buffer fill ratio = 42.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere

QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_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 3128 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 = 10240 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 = 64 tables
You have a total of 1038 tables
You have 64 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 110436 temp tables, 0% 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 = 776 : 1
read_buffer_size seems to be fine

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


bu scripti çaliştirdiğimda çikan sonuç budur buna göre bir my.cnf alabilirmiyim bazen load seviyelerim çok artiyor ve top -c çektiğimde mysql kullanimim % 100 % 200 olabiliyor Quad core 2.4 9500 işlemcim ve 8 gb ram var şimdiden teşekkürler

Şuanda Kullandıgınız my.cnf unuzuda yazarsanız ona göre my.cnf vereyim.

x1y2 11-11-2008 03:07:08

[mysqld]
max_user_connections=2048
max_connections=2048

sadece budur

Coşkun Çetin 11-11-2008 09:34:47

Alıntı:

x1y2 Nickli Üyeden Alıntı (Mesaj 2747669)
[mysqld]
max_user_connections=2048
max_connections=2048

sadece budur

Bunlar en ufak saldırıda sunucunuzun daha hızlı down olması için saldırana %100 kolaylık sağlar.

max_user_connections : mysql sunucusuna eş zamanlı yapılan bağlantı sayısını belirler.Bence gerekmedikçe 256'yı geçmemeli ama duruma ve sisteme göre değişir

max_connections : Bir istemcinin eş zamanlı olarak suncuya yaptığı azami bağlantı sayısını belirler.Too Many connection hatasına neden olan değişken budur.
Linux veya Solaris sistemler için tavsiye edilen değer 500-1000 arasıdır.

tabi bunlar sisteminize ve mysql ihtiyaçlarına göre değişir

My.cnf dosyanızı yapamıyorum çünkü

"Uptime = 0 days 8 hrs 51 min 41 sec"

8 saat açık kaldıktan sonra bu Rapor alınmış.

Lütfen MySQL 'i Restartlamadan 2gün çalıştırıp daha sonra Raporu alıp burada koyunuz

O zaman vereceğim my.cnf 'un size çok büyük katkısı olacaktır

canerbey 16-03-2009 15:28:58

mysql sorunu
 
mysql 24 saatten fazla restart edilmeden çalıştı

Kod:

mysqld is alive
        -- MYSQL PERFORMANCE TUNING PRIMER --
            - By: Matthew Montgomery -
MySQL Version 5.0.67-community i686
./tuning-primer.sh: line 389: bc: command not found
./tuning-primer.sh: line 390: bc: command not found
./tuning-primer.sh: line 391: bc: command not found
./tuning-primer.sh: line 392: bc: command not found
./tuning-primer.sh: line 393: bc: command not found
./tuning-primer.sh: line 394: bc: command not found
Uptime =  days  hrs  min  sec
Avg. qps = 6
Total Questions = 509730
Threads Connected = 82
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:
http://dev.mysql.com/doc/refman/5.0/en/server-system-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 2203 out of 509757 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 http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html
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 = 100
Current threads_connected = 80
Historic max_used_connections = 101
The number of used connections is 101% of the configured maximum.
You should raise max_connections
MEMORY USAGE
./tuning-primer.sh: line 1205: bc: command not found
./tuning-primer.sh: line 1206: bc: command not found
./tuning-primer.sh: line 1230: bc: command not found
./tuning-primer.sh: line 1233: bc: command not found
./tuning-primer.sh: line 1234: bc: command not found
./tuning-primer.sh: line 1236: bc: command not found
./tuning-primer.sh: line 1238: [: -gt: unary operator expected
./tuning-primer.sh: line 351: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 357: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 363: [: max_memoryHR: integer expression expected
./tuning-primer.sh: line 370: export: `0=max_memoryHR': not a valid identifier
Max Memory Ever Allocated :  bytes
./tuning-primer.sh: line 351: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 357: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 363: [: per_thread_buffersHR: integer expression expected
./tuning-primer.sh: line 370: export: `0=per_thread_buffersHR': not a valid identifier
Configured Max Per-thread Buffers :  bytes
./tuning-primer.sh: line 351: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 357: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 363: [: global_buffersHR: integer expression expected
./tuning-primer.sh: line 370: export: `0=global_buffersHR': not a valid identifier
Configured Max Global Buffers :  bytes
./tuning-primer.sh: line 351: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 357: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 363: [: total_memoryHR: integer expression expected
./tuning-primer.sh: line 370: export: `0=total_memoryHR': not a valid identifier
Configured Max Memory Limit :  bytes
./tuning-primer.sh: line 332: bc: command not found
Physical Memory :  G
Max memory limit seem to be within acceptable norms
KEY BUFFER
./tuning-primer.sh: line 332: bc: command not found
./tuning-primer.sh: line 647: bc: command not found
./tuning-primer.sh: line 648: bc: command not found
./tuning-primer.sh: line 332: bc: command not found
Current MyISAM index space =  M
./tuning-primer.sh: line 332: bc: command not found
Current key_buffer_size =  M
Key cache miss rate is 1 : 348
Key buffer fill ratio =  %
./tuning-primer.sh: line 685: [: -ge: unary operator expected
./tuning-primer.sh: line 689: [: -le: unary operator expected
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_size
SORT OPERATIONS
./tuning-primer.sh: line 332: bc: command not found
Current sort_buffer_size =  M
./tuning-primer.sh: line 332: bc: command not found
Current read_rnd_buffer_size =  K
Sort buffer seems to be fine
JOINS
./tuning-primer.sh: line 332: bc: command not found
Current join_buffer_size =  K
You have had 64 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 = 1024 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 = 64 tables
You have a total of 1029 tables
You have 149 open tables.
Current table_cache hit rate is 0%, while 232% of your table cache is in use
You should probably increase your table_cache
TEMP TABLES
./tuning-primer.sh: line 332: bc: command not found
Current max_heap_table_size =  M
./tuning-primer.sh: line 332: bc: command not found
Current tmp_table_size =  M
Of 33774 temp tables, 74% 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
./tuning-primer.sh: line 332: bc: command not found
Current read_buffer_size =  K
Current table scan ratio = 809 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 26
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'.

Kod:

root@host [~]# cat /etc/my.cnf
[mysqld]
skip-bdb
skip-innodb


Juniorturko 05-05-2009 00:00:57

Merhaba bende yardiminizi alabilirmiyim mysql ayarlarindan hic anlamiyorum .

Sistemimiz,

Parallels Plesk Panel version 9.0.1
Operating system Linux 2.6.18-92.el5PAE
CPU GenuineIntel, Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
Average load 1.58; 1.24; 0.97
4 GB RAM
Delicated server uzerinde suan tek sitemiz bulunmaktadir.


Kod:

        [1;34m-- MYSQL PERFORMANCE TUNING PRIMER --
            - By: Matthew Montgomery -
MySQL Version 5.0.45 i686
Uptime = 14 days 5 hrs 6 min 59 sec
Avg. qps = 87
Total Questions = 107259074
Threads Connected = 16
Server has been running for over 48hrs.
It should be safe to follow these recommendations
[31mTo find out more information on how each of these
[31mruntime variables effects performance visit:
[1;34mhttp://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
[1;34mVisit http://www.mysql.com/products/enterprise/advisors.html
[1;34mfor info about MySQL's Enterprise Monitoring and Advisory Service
[1;34mSLOW QUERIES
The slow query log is [1;31mNOT enabled.
Current long_query_time = 10 sec.
You have [1;31m453 out of [1;31m107259108 that take longer than 10 sec. to complete
[31mYour long_query_time may be too high, I typically set this under 5 sec.
[1;34mBINARY UPDATE LOG
The binary update log is [1;31mNOT enabled.
[31mYou will not be able to do point in time recovery
[33mSee http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html
[1;34mWORKER THREADS
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 14
Historic threads_per_sec = 12
[31mThreads created per/sec are overrunning threads cached
[31mYou should raise thread_cache_size
[1;34mMAX CONNECTIONS
Current max_connections = 100
Current threads_connected = 10
Historic max_used_connections = 101
The number of used connections is [31m101% of the configured maximum.
[31mYou should raise max_connections
[1;34mMEMORY USAGE
Max Memory Ever Allocated : 289 M
Configured Max Per-thread Buffers : 268 M
Configured Max Global Buffers : 17 M
Configured Max Memory Limit : 286 M
Physical Memory : 3.94 G
[32mMax memory limit seem to be within acceptable norms
[1;34mKEY BUFFER
Current MyISAM index space = 55 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 362
Key buffer free ratio = 0 %
[1;31mYou 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.
[1;34mQUERY CACHE
[31mQuery cache is supported but not enabled
[31mPerhaps you should set the query_cache_size
[1;34mSORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
[32mSort buffer seems to be fine
[1;34mJOINS
Current join_buffer_size = 132.00 K
You have had 484 queries where a join could not use an index properly
[31mYou have had 40 joins without keys that check for key usage after each row
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.
[1;31mNote! This script will still suggest raising the join_buffer_size when
[1;31mANY joins not using indexes are found.
[1;34mOPEN FILES LIMIT
Current open_files_limit = 65535 files
[33mThe open_files_limit should typically be set to at least 2x-3x
[33mthat of table_cache if you have heavy MyISAM usage.
[32mYour open_files_limit value seems to be fine
[1;34mTABLE CACHE
Current table_cache value = 64 tables
You have a total of 800 tables
You have [1;31m64 open tables.
Current table_cache hit rate is [1;31m0%, while [1;31m100% of your table cache is in use
[31mYou should probably increase your table_cache
[1;34mTEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 32 M
Of 1098615 temp tables, 17% were created on disk
[33mEffective in-memory tmp_table_size is limited to max_heap_table_size.
[32mCreated disk tmp tables ratio seems fine
[1;34mTABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 83 : 1
[32mread_buffer_size seems to be fine
[1;34mTABLE LOCKING
Current Lock Wait ratio = [31m1 : 64
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.conf
Kod:

[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
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

ne tur bir ayar yapmam gerekmektedir yardimci olacak arkadaslara tesekkur ederim.


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 13:26:10.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.