Hiển thị các bài đăng có nhãn Centos. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Centos. Hiển thị tất cả bài đăng

[Video] Cài đặt CentOS 7.0 trên VMware

Đây là video đầu tiên của bộ lab CentOS Linux Basic. Mục đích của bộ lab này là tổng hợp những bài lab cấu hình cơ bản để phát triển những bài lab nâng cao về sau.

Bộ lab này gồm:

1. Cài đặt CentOS trên VMware
2. Cấu hình cơ bản trên CentOS
3. ...

Video lab 01: Cài đặt CentOS trên VMware


Tối ưu dịch vụ MySQL cho VPS 1G RAM


Việc tối ưu dịch vụ MySQL rất quan trọng, cải thiện đáng kể tốc độ load trang và truy xuất dữ liệu. Trong bài viết này chúng tôi sẽ hướng dẫn tối ưu dịch vụ MySQL cho VPS linux 1G ram.

#vi /etc/my.cnf

Nhập nội dung sau:

[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

#service mysqld restart




Làm thế nào để tối ưu MySQL trên linux ?

Làm thế nào để tối ưu MySQL là một câu hỏi rất phổ biến trong giới System Admin. Hôm nay CCNETVN chia sẻ cách tối ưu cơ bản MySQL trên môi trường Centos.








MySQL 5.x

#cp /etc/my.cnf /etc/my.cnf.old
#vi /etc/my.cnf

Sửa các thông số như sau:

[mysqld]
port  = 3306
socket  = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

MySQL 4.x

[mysqld]
local-infile=0
skip-locking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1
[safe_mysqld]
err-log=/var/log/mysqld.log
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

Restart lại dịch vụ:

#service mysqld restart