-->

Sunday, September 7, 2014

MySQL Optimization | DB Optimization | Database Optimization | How to optimize MySQL

 Optimize MySQL
  • CPU cycles. When exist  data in main memory,  need to process it to get our result. Having large tables compared to the amount of memory is the most common limiting factor. But with small tables, speed is usually not the problem.
  • Disk seeks. It takes time for the disk to find out a piece of data. With modern disks, the mean time for this is usually lower than 10ms, so we can in theory do about 100 seeks a second. This time improves slowly with new disks and is very hard to optimize for a single table. The way to optimize seek time is to distribute the data onto more than one disk.
  • Disk reading and writing. When the disk is at the right position, we need to read the data. With modern disks, one disk delivers at least 10–20MB/s throughput. This is easier to optimize than seeks because you can read in parallel from multiple disks.
  • Memory bandwidth. When the CPU needs more data processing  than can fit in the CPU cache, main memory bandwidth becomes a bottleneck. This is an uncommon bottleneck for most systems, but one to be aware of.

No comments:

Post a Comment