Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   Mysql Server (http://quantrinet.com/forum/forumdisplay.php?f=153)
-   -   Tối ưu hóa mysql vps 1gb ram (http://quantrinet.com/forum/showthread.php?t=9669)

hoctinhoc 21-11-2014 02:32 PM

Tối ưu hóa mysql vps 1gb ram
 
TỐI ƯU HÓA MYSQL VPS 1GB RAM

Đăng nhập SSH vào VPS với account root

1. Sao lưu tập tin my.cnf


cp /etc/my.cnf /etc/my.cnf.old


2. Chỉnh sửa tập tin my.cnf


[mysqld]
max_connections = 400
key_buffer = 32M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1024
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 1000
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 16M
query_cache_type = 1
tmp_table_size = 16M

[mysqld_safe]
open_files_limit = 8192

[mysqldump]

quick

max_allowed_packet = 16M

[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
local-infile=0



Lưu lại tập tin my.cnf sau đó khởi động lại dịch vụ MYSQL:


service mysqld restart



Bây giờ là 04:59 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.