راهنمایی در مورد بهینه سازی MySQL
سلام
من یه سرور مجازی لینوکس centos 6.5 دارم با کنترل پنل دایرکت ادمین
cpu: 3هسته ای
رم: 6 گیگ
چه کانفیگی مناسب هست که توی فایل my.cnf بذارم
الان این فایل خالی هستش و هیچی توش نیست
پاسخ : راهنمایی در مورد بهینه سازی MySQL
سلام
کانفیگ و بهینه سازی باید با توجه به مصرف اسکریپت انجام بشه.
از چه اسکریپتی استفاده میکنید؟
پاسخ : راهنمایی در مورد بهینه سازی MySQL
سلام
این کانفیگ برای این منابع خوب هست ولی باز باید بیشتر بررسی بشه چون من نمیدونم روی سرور شما چه اسکریپتی نصب هست:
[mysqld]
skip-innodb
default-storage-engine = MyISAM
long_query_time = 3
back_log = 50
max_connections = 500
max_user_connections= 200
key_buffer_size = 512M
myisam_sort_buffer_size = 64M
myisam_max_sort_file_size = 2048M
join_buffer_size = 2M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 12000
thread_cache_size = 1024
wait_timeout = 1000
interactive_timeout = 500
connect_timeout = 600
tmp_table_size = 256M
max_heap_table_size = 256M
max_allowed_packet = 128M
net_buffer_length = 16384
max_connect_errors = 100000
thread_concurrency = 16
concurrent_insert = 2
read_rnd_buffer_size = 1M
bulk_insert_buffer_size = 8M
query_cache_limit = 4M
query_cache_size = 128M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
range_alloc_block_size = 4096
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
default-storage-engine = MyISAM
max_write_lock_count = 8
local-infile=0
open_files_limit=15638
local-infile=0
open_files_limit=15638
پاسخ : راهنمایی در مورد بهینه سازی MySQL
نقل قول:
نوشته اصلی توسط
novin-web
سلام
این کانفیگ برای این منابع خوب هست ولی باز باید بیشتر بررسی بشه چون من نمیدونم روی سرور شما چه اسکریپتی نصب هست:
[mysqld]
skip-innodb
default-storage-engine = MyISAM
long_query_time = 3
back_log = 50
max_connections = 500
max_user_connections= 200
key_buffer_size = 512M
myisam_sort_buffer_size = 64M
myisam_max_sort_file_size = 2048M
join_buffer_size = 2M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 12000
thread_cache_size = 1024
wait_timeout = 1000
interactive_timeout = 500
connect_timeout = 600
tmp_table_size = 256M
max_heap_table_size = 256M
max_allowed_packet = 128M
net_buffer_length = 16384
max_connect_errors = 100000
thread_concurrency = 16
concurrent_insert = 2
read_rnd_buffer_size = 1M
bulk_insert_buffer_size = 8M
query_cache_limit = 4M
query_cache_size = 128M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
range_alloc_block_size = 4096
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
default-storage-engine = MyISAM
max_write_lock_count = 8
local-infile=0
open_files_limit=15638
local-infile=0
open_files_limit=15638
درود
بردار گرامی کانفیگ شما اول اینکه روی mysql 5.6 جوابگو نیست و باعث میشه mysql استارت نشود بدلیل وجود table cache که در mysql 5.6 به بعد ساپورت نمیشود
و دوم اینکه استفاده از مقادیری مانند skip-innodb باعث از کار افتادن اسکریپت های تحت innodb مانند برخی انجمن ها میشود و مشکلات دیگر..
ضمن تشکر از شما که هدفتون کمک هستش پیشنهاد میکنم در مورد مواردی که به کاربران کمک میکنید اطلاعات دقیق تری ذکر کنید
ارادت
:53:
پاسخ : راهنمایی در مورد بهینه سازی MySQL
نقل قول:
نوشته اصلی توسط
python
سلام
من یه سرور مجازی لینوکس centos 6.5 دارم با کنترل پنل دایرکت ادمین
cpu: 3هسته ای
رم: 6 گیگ
چه کانفیگی مناسب هست که توی فایل my.cnf بذارم
الان این فایل خالی هستش و هیچی توش نیست
از https://raw.github.com/rackerhacker/.../mysqltuner.pl برای بهینه کردن استفاده کنید برای تنظیمات معمولی برای شما مناسب است
پاسخ : راهنمایی در مورد بهینه سازی MySQL
نقل قول:
نوشته اصلی توسط
OPENFIRE
سلام
کانفیگ و بهینه سازی باید با توجه به مصرف اسکریپت انجام بشه.
از چه اسکریپتی استفاده میکنید؟
از وردپرس و سیستم پاپ آپ xdev استفاده میکنم
- - - Updated - - -
نقل قول:
نوشته اصلی توسط
nginxweb
درود
بردار گرامی کانفیگ شما اول اینکه روی mysql 5.6 جوابگو نیست و باعث میشه mysql استارت نشود بدلیل وجود table cache که در mysql 5.6 به بعد ساپورت نمیشود
و دوم اینکه استفاده از مقادیری مانند skip-innodb باعث از کار افتادن اسکریپت های تحت innodb مانند برخی انجمن ها میشود و مشکلات دیگر..
ضمن تشکر از شما که هدفتون کمک هستش پیشنهاد میکنم در مورد مواردی که به کاربران کمک میکنید اطلاعات دقیق تری ذکر کنید
ارادت
:53:
بله دقیقا حق با شماست چون mysql داون شد و استارت نشد
- - - Updated - - -
نقل قول:
نوشته اصلی توسط
storage
طرز کارش چگونه هست؟
پاسخ : راهنمایی در مورد بهینه سازی MySQL
پاسخ : راهنمایی در مورد بهینه سازی MySQL
نقل قول:
نوشته اصلی توسط
python
از وردپرس و سیستم پاپ آپ xdev استفاده میکنم
- - - Updated - - -
بله دقیقا حق با شماست چون mysql داون شد و استارت نشد
- - - Updated - - -
طرز کارش چگونه هست؟
فایل پرل هست دریافت و اجرا کنید 5-10 دقیقه منتظر باشید تا نتیجه بهشما بگوید
پاسخ : راهنمایی در مورد بهینه سازی MySQL
نقل قول:
نوشته اصلی توسط
storage
فایل پرل هست دریافت و اجرا کنید 5-10 دقیقه منتظر باشید تا نتیجه بهشما بگوید
اینارو داد
کدوم هارو بذارم توی my.cnf?
اون فایلم کلا خالیه
کد HTML:
>> MySQLTuner 1.3.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[OK] Currently running supported MySQL version 5.5.31
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 250M (Tables: 203)
[--] Data in InnoDB tables: 183M (Tables: 317)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 0B (Tables: 1)
[!!] Total fragmented tables: 333
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 6h 36m 31s (3M q [153.599 qps], 212K conn, TX: 12B, RX: 299M)
[--] Reads / Writes: 97% / 3%
[--] Total buffers: 168.0M global + 2.8M per thread (151 max threads)
[OK] Maximum possible memory usage: 583.2M (9% of installed RAM)
[OK] Slow queries: 0% (0/3M)
[OK] Highest usage of available connections: 13% (21/151)
[OK] Key buffer size / total MyISAM indexes: 8.0M/182.7M
[OK] Key buffer hit rate: 98.4% (1B cached / 16M reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (179 temp sorts / 610K sorts)
[!!] Temporary tables created on disk: 42% (173K on disk / 405K total)
[!!] Thread cache is disabled
[!!] Table cache hit rate: 3% (393 open / 11K opened)
[OK] Open file limit used: 40% (410/1K)
[OK] Table locks acquired immediately: 99% (2M immediate / 2M locks)
[!!] InnoDB buffer pool / data size: 128.0M/183.7M
[OK] InnoDB log waits: 0
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Set thread_cache_size to 4 as a starting value
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
Variables to adjust:
query_cache_size (>= 8M)
tmp_table_size (> 16M)
max_heap_table_size (> 16M)
thread_cache_size (start at 4)
table_open_cache (> 400)
innodb_buffer_pool_size (>= 183M)
پاسخ : راهنمایی در مورد بهینه سازی MySQL
نقل قول:
نوشته اصلی توسط
python
اینارو داد
کدوم هارو بذارم توی my.cnf?
اون فایلم کلا خالیه
کد HTML:
>> MySQLTuner 1.3.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[OK] Currently running supported MySQL version 5.5.31
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 250M (Tables: 203)
[--] Data in InnoDB tables: 183M (Tables: 317)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[--] Data in MEMORY tables: 0B (Tables: 1)
[!!] Total fragmented tables: 333
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 6h 36m 31s (3M q [153.599 qps], 212K conn, TX: 12B, RX: 299M)
[--] Reads / Writes: 97% / 3%
[--] Total buffers: 168.0M global + 2.8M per thread (151 max threads)
[OK] Maximum possible memory usage: 583.2M (9% of installed RAM)
[OK] Slow queries: 0% (0/3M)
[OK] Highest usage of available connections: 13% (21/151)
[OK] Key buffer size / total MyISAM indexes: 8.0M/182.7M
[OK] Key buffer hit rate: 98.4% (1B cached / 16M reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (179 temp sorts / 610K sorts)
[!!] Temporary tables created on disk: 42% (173K on disk / 405K total)
[!!] Thread cache is disabled
[!!] Table cache hit rate: 3% (393 open / 11K opened)
[OK] Open file limit used: 40% (410/1K)
[OK] Table locks acquired immediately: 99% (2M immediate / 2M locks)
[!!] InnoDB buffer pool / data size: 128.0M/183.7M
[OK] InnoDB log waits: 0
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Set thread_cache_size to 4 as a starting value
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
Variables to adjust:
query_cache_size (>= 8M)
tmp_table_size (> 16M)
max_heap_table_size (> 16M)
thread_cache_size (start at 4)
table_open_cache (> 400)
innodb_buffer_pool_size (>= 183M)
در زیر نوشته شده مقادیر مورد نظر تغییر بدهید
query_cache_size (>= 8M)
tmp_table_size (> 16M)
max_heap_table_size (> 16M)
thread_cache_size (start at 4)
table_open_cache (> 400)
innodb_buffer_pool_size (>= 183M)