Notes on optimizing the performance of php and mysql

Source: Internet
Author: User

Notes on Performance Optimization of php and mysql tutorials

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

Php program page mysql closed in time

Set mysql timeout
Low-priority-updates

 


Tmp_table_size = 200 m; larger memory usage
Low_priority_updates = no; set the read priority
Wait_timeout = 10; about 10 seconds.
Table_cache = 1024; the larger the physical memory, the larger the setting. The default value is 2402. The optimal value is adjusted to 512-1024.
Key_buffer_size = 1024 m;
Sort_buffer_size = 256 m;
Read_buffer_size = 1024 m;
Join_buffer_size = 512 m;
Read_rnd_buffer_size = 1024 m; sort by user order
Max-seeks-for-key = 1000; limit keyword scan does not exceed 1,000 keyword searches

According to General mysql memory computing companies:
1) used by the system. Assume that 800 m is reserved;
2) Exclusive thread, about 4.5 gb = 151*(10 m + 10 m + 5 m + 5 m + 512 k), the composition is roughly as follows:
Sort_buffer_size: 10 m
Join_buffer_size: 10 m
Read_buffer_size: 5 m
Read_rnd_buffer_size: 5 m
Thread_stack: 512kb
3) myisam key cache
Key_buffer_size 2.4g
4) innodb buffer pool: Ignore. Currently, the innodb Storage engine table does not exist.


The number of mysql connections per cpu should not exceed 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.