Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 07-09-2011, 03:59 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Tối ưu MySQL - MySQL Tweaking
MySQL Tweaking – Tối ưu MySQL



Với cPanel or Plesk hay cài đặt MySQL bình thường bao giờ sau khi cài xong MySQL cũng chạy với những config mặc định. Nó không tối ưu và tốt cho server. Đặc biệt là với hosting provider.
Đây là cấu hình tốt cho MySQL.

Sửa file /etc/my.cnf Xóa hết nội dung đã có, thay thành:
Mã:
[mysqld]
max_connections=900
max_user_connections=50
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
interactive_timeout=50
wait_timeout=50
connect_timeout=10
thread_cache_size=128
key_buffer=256M
max_allowed_packet=16M
table_cache=1024
join_buffer=1M
sort_buffer_size=1M
read_buffer_size=1M
max_connect_errors=10
thread_concurrency=4
myisam_sort_buffer_size=64M
log-bin
server-id=1
 [safe_mysqld]
open_files_limit=8192
 [mysqldump]
quick
max_allowed_packet=16M
 [mysql]
no-auto-rehash
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
 [myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
 [mysqlhotcopy]
interactive-timeout 

Chuc cac ban thanh cong!





  Trả lời ngay kèm theo trích dẫn này
Tuổi 10-10-2014, 02:14 PM   #2
hoctinhoc
Guest
 
Trả Lời: n/a
Mysql chạy tốn nhiều cpu, ram và cách kiểm tra
Mysql chạy tốn nhiều cpu, ram và cách kiểm tra



Đôi khi mysql chạy chiếm nhiều cpu, ram để kiểm tra process nào chạy nhiều bạn theo các bước sau


1. Truy cập mysql


#mysql -u root -p


2. Xem có bao nhiêu connections trong mysql


mysql> show status like '%onn%';

3. Xem có nhau nhiều process mysql đang xử lýmysql> show processlist;


4. Xem trang thái mysql

mysql> SHOW STATUS;

5. Xem và kill process mysqlmysql> SHOW PROCESSLIST;

mysql> KILL 27;
  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 01:13 AM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.