PHP and MySQL performance tuning notes

Source: Internet
Author: User
Tags mysql tutorial php and mysql

PHP tutorials and MySQL tutorial performance tuning notes

The larger the tmp_table_size=200m tmp_table_size, the smaller the probability of being converted to a disk TMP table

PHP Program page MySQL closed in time

Set the MySQL timeout time
Low-priority-updates set query and update priority and


tmp_table_size=200m; The greater the use of memory, the more
Low_priority_updates = no; set Read priority
Wait_timeout = 10; It'll take about 10 seconds.
table_cache=1024; The larger the physical memory, the larger the setting. The default is 2402, tuned to 512-1024 best
Key_buffer_size =1024m;
Sort_buffer_size = 256m;
Read_buffer_size = 1024m;
Join_buffer_size = 512m;
Read_rnd_buffer_size = 1024m; User ORDER by sort
max-seeks-for-key=1000; Limit keyword Scan does not exceed 1,000 times keyword search

According to the general MySQL Memory computing company:
1) system use, assuming that 800m is reserved;
2 thread exclusive, about 4.5GB = 151 * (10m + 10m + 5m + 5m + 512k), the composition is approximately as follows:
sort_buffer_size:10m
join_buffer_size:10m
Read_buffer_size:5m
Read_rnd_buffer_size:5m
thread_stack:512kb
3) MyISAM Key cache
Key_buffer_size 2.4g
4 InnoDB buffer pool: ignored, the system currently does not have a InnoDB storage engine table.


MySQL connection number single CPU preferably not more than 300

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.