wmaraci reklam

mysql optimizasyonu

3 Mesajlar 691 Okunma
pst.net
wmaraci reklam

GunduzT GunduzT WM Aracı Kullanıcı
  • Üyelik 29.01.2019
  • Yaş/Cinsiyet 38 / E
  • Meslek web tasarımı
  • Konum İstanbul Anadolu
  • Ad Soyad G** T**
  • Mesajlar 105
  • Beğeniler 104 / 46
  • Ticaret 0, (%0)
Merhaba,

Debian 9.6 (64bit) işletim sistemi üzerinde Mysql (mariadb) veritabanı kullanan Wordpress bir sitem var. (+apache, php 7.2)

Oldukça yüksek hit alan bir site. (aylık bandwith kullanımı çok terabyte)

işlemci Intel i5-4590- 3.30GHz (4 çekirdek)
ram 32 gb ddr3
SSD disk var.
Makinede tek bu site var.

performans sorunu yaşadığım için bazı pluginleri kapatmak zorunda kaldım.
4 çekirdek olmasına rağmen işlemci kullanımının (top değeri) 20-30'u gördüğü zamanlar çok.
Hatta nadirde olsa trafik yükseldiğinde sitenin cevap veremez olduğu oluyor.

mysql'i nasıl optimize ederim diye araştırırken tüm siteler tuning-primer.sh adlı bir scripte yonlendirdi.

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

MySQL Version 10.1.37-MariaDB-0+deb9u1 x86_64

Uptime = 2 days 2 hrs 43 min 57 sec
Avg. qps = 179
Total Questions = 30073231
Threads Connected = 2

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/10.1/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 = 4.000000 sec.
You have 9420 out of 30073248 that take longer than 4.000000 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/10.1/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 12
Current threads_cached = 9
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

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

No InnoDB Support Enabled!

MEMORY USAGE

Max Memory Ever Allocated : 10.82 G
Configured Max Per-thread Buffers : 881 M
Configured Max Global Buffers : 10.39 G
Configured Max Memory Limit : 11.25 G
Physical Memory : 31.32 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 43 M
Current key_buffer_size = 256 M
Key cache miss rate is 1 : 1725736
Key buffer free ratio = 66 %
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 = 97 M
Current query_cache_limit = 4 M
Current Query cache Memory fill ratio = 76.01 %
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 = 388.00 K
You have had 1033509 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 = 16364 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_open_cache = 8017 tables
Current table_definition_cache = 400 tables
You have a total of 149 tables
You have 567 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 192 M
Current tmp_table_size = 192 M
Of 3577982 temp tables, 43% were created on disk
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 = 128 K
Current table scan ratio = 915 : 1
read_buffer_size seems to be fine

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

veritabanındaki wp_posts tablosu MyISAM kalan tüm tablolar InnoDB.

yeni daha güçlü bir servera geçeceğim ama geçmeden önce mysql'i biraz optimize etmek istiyorum.
mysql bilgim zayıf.
yukarıdaki rapora göre hangi değerleri değiştirmemi önerirsiniz?

Database'in toplam büyüklüğü = 3.7 GB

şimdiden teşekkürler.
 

 

wmaraci
reklam

alperi alperi alperperi.com Kullanıcı
  • Üyelik 23.11.2016
  • Yaş/Cinsiyet 41 / E
  • Meslek Bilgiişlem
  • Konum Konya
  • Ad Soyad A** P**
  • Mesajlar 642
  • Beğeniler 216 / 215
  • Ticaret 4, (%100)
MySQLTuner denediniz mi? Buradan bilgi alabilirsiniz.
GunduzT

kişi bu mesajı beğendi.

cliaweb cliaweb Web Hosting Sağlayıcı Kullanıcı
  • Üyelik 05.03.2014
  • Yaş/Cinsiyet 34 / E
  • Meslek Hosting Sağlayıcısı
  • Konum Muğla
  • Ad Soyad R** Y**
  • Mesajlar 1020
  • Beğeniler 356 / 356
  • Ticaret 8, (%100)
Merhaba GunduzT

Mysql tuner size net veriler sunmaz, kısmi önerilerde bulunabilir. Önerileri ise şu şekildedir , deneme yanılma yöntemi ile performans izlemesi yapmanızı öneririz ;

key_buffer = < azalt
query_cache_size = > yükselt
query_cache_used = > yükselt
query_cache_limit = > yükselt
open_files_limit > yükselt
max_heap_table_size > yükselt

Ek olarak ilgili fiziksele ait donanımda çok büyük bir site olmalısınız (veya optimizesiz script + sunucu) ki kaynak sorunu yaşayasınız. Fizikselinizde olası bir donanımsal sorun olma ihtimalinide es geçmeyin.

İyi çalışmalar dileriz.
GunduzT

kişi bu mesajı beğendi.

Linux Hosting | Linux Reseller | VPS | VDS https://www.cliaweb.com - İletişim : +90 (850) 885 10 39
wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al