MySQL có thể lưu kết quả của một truy vấn trong bộ nhớ cache riêng của nó. Để kích hoạt nó chỉnh sửa các tập tin cấu hình MySQL (thường /etc/my.cnf) và thêm những dòng này:
query_cache_type = 1
query_cache_limit = 1M
query_cache_size = 16M
Tối ưu vps
Toi uu vps
Để đánh giá xem nó đúng là chạy, chạy truy vấn này:
SHOW STATUS LIKE ‘Qcache%’;
sieutocvietLà phương pháp SEO phối hợp ăn nhịp giữa viết nội dung website có khoa học kỹ thuật tối ưu website đương nhiên 1 số tiêu chuẩn SEO lên top nhằm thỏa mãn hàng trăm buộc phải của Google. Website seo vững bền với thể ko cần top 1,2,3 sở hữu thể top 3,4,5 nhưng nó sẽ còn đó những vị trí TOP với cả trong khoảng khóa chính và trong khoảng khóa phụ theo năm tháng dù google đổi thay cập nhật thuật toán bao nhiêu lần đi nữa. không những thế Seo vững bền tăng sức mạnh còn phải cần biết kết hợp sở hữu các nhà sản xuất trả phí của ngay chính google vừa mang lại doanh số vừa bổ trợ thêm sức mạnh cho seo trong khoảng khóa vững bền nâng cao vị trí vững bền. Seo bền vững còn là seo cả nhưng mạng phường hội hàng đầu và kết hợp và tận dụng sức mạnh đó để tiếp cận thêm phân khúc doanh số và tạo nên một sức mạnh vững bền cho SEO lớn hơn thay việc chỉ search google kiếm tìm.
Kết quả:
Qcache_free_blocks | 718 |
Qcache_free_memory | 13004008 |
Qcache_hits | 780759 |
Qcache_inserts | 56292 |
Qcache_lowmem_prunes | 0 |
Qcache_not_cached | 3711 |
Qcache_queries_in_cache | 1715 |
Qcache_total_blocks | 4344 |
Cách tối ưu vps
Hơn nữa MySQL tối ưu hóa:
Có rất nhiều tùy chọn, bạn có thể chơi với như vậy ở đây là tập tin cấu hình MySQL của tôi thay vào đó, điều chỉnh trong hosting giá rẻ 4GB, quad-core máy chuyên dụng. Điều này có thể sẽ không làm việc cho hầu hết các máy tính của bạn ra khỏi hộp, tiêu dùng nó giống như một hướng dẫn chung.
[mysqld] bulk_insert_buffer_size = 8M
connect_timeout=10
interactive_timeout=50
join_buffer=1M
key_buffer=250M
max_allowed_packet=16M
max_connect_errors=10
max_connections=100
max_heap_table_size = 32M
myisam_sort_buffer_size=96M
query_cache_limit = 4M
query_cache_size = 250M
query_cache_type = 1
query_prealloc_size = 65K
query_alloc_block_size = 128K
read_buffer_size=1M
read_rnd_buffer_size=768K
record_buffer=1M
safe-show-database
skip-innodb
skip-locking
skip-networking
sort_buffer=1M
table_cache=4096
thread_cache_size=1024
thread_concurrency=8
tmp_table_size = 32M
wait_timeout=500# for slow queries, comment when not used
[mysqld_safe] nice = -5
#log-slow-queries=/var/log/mysql-slow.log
#long_query_time=1
#log-queries-not-using-indexes
open_files_limit = 8192 [mysqldump] quick
max_allowed_packet = 16M [myisamchk] key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16MPHP Opcode Cache
phpize
./configure
make
make installĐiều này sẽ cài đặt eAccelerator.
Tiếp theo, tạo thư mục tạm để lưu trữ:mkdir /var/cache/eaccelerator
chmod 0777 /var/cache/eaccelerator
Finally to enable it, add these lines to the end of your php.ini file (usually /etc/php.ini or /usr/lib/php.ini):
extension=”eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/var/cache/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=””
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″