문제

Generally bottleneck of RDBMS (I am a MySQL user) performance is disk access. SSD provides great performance compared with conventional spindle drives.

Question : Is it possible to improve performance by attaching multiple drives of reduced space, because this way more heads will be available to read data?

Like replacing 2TB 7.2k RPM drive with 4 500GB 7.2k RPM drives?

도움이 되었습니까?

해결책

This could depend a great deal on the storage engine.

For MyISAM, I think it would be a great idea because you can make data as contiguous as a you want. That would benefit queries involving bulk operations and large range scans. The toolset for compressing and repairing MyISAM to improve the table format can also make access a little better. IMHO concurrent INSERTs could thrive in such a disk environment.

InnoDB is a completely different story.

If you have innodb_file_per_table disabled, data can be scattered throughout ibdata1 and thus scattered amongst the multiple disks. You could run OPTIMIZE TABLE against an InnoDB table and make the data and index pages contiguous, but that could cause two problems:

  1. Makes the ibdata1 grow
  2. Deteriorate performance over time

Don't forget the four types of data that reside in ibdata1:

  • Table MetaData
  • Table Data Pages
  • Index Data Pages
  • MVCC Data

There is constant writing of MVCC Data to protect data integrity. There is also constant interaction with ib_logfile0 and ib_logfile1 (redo logs). There is constant data flushing every 10 seconds from the InnoDB Buffer Pool back to the . Overall, it is safe to say that the spread of data across multiple disks and the I/O performance can show marginal-to-modest performance improvement until there is enough fragmentation within ibdata1.

Now, if innodb_file_per_table is enabled, things could be a little messier. Here is why:

Once you cleanup ibdata1 and separate all InnoDB tables from ibdata1, you will have a smaller ibdata1. However, each access to an InnoDB table requires navigating its use through ibdata1 ALL THE TIME via Table Metadata. You literally cannot semantically separate the table metadata (ibdata1) from the table (.ibd). Wherever ibdata1 lives, disk I/O must always pass through ibdata1.

Overall effect: Table fragmentation is limited to .ibd files and can be reduced and reorganized with OPTIMIZE TABLE, but no additional I/O performance enhancement is really achieved.

What about putting all .ibd files into a different set of disks apart from ibdata1 and using symlinks? According to Percona, that creates more mayhem.

CONCLUSION

When it comes to using multiple drives over a single drive, I highly favor MyISAM over InnoDB.

다른 팁

Yes, multiple drives will provide better throughput thanks to the wonderful technology we call RAID. For a database you'll want RAID 10 (striped mirrors).

With 4(N) drives you would double(N/2) your write speed and quadruple(N) sequential read throughput. Seek times will stay roughly the same though, and you'll lose half the space to mirroring.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top