fdisk /dev/sda mke2fs -t ext3 /dev/sda4 mount /dev/sda4 /bench -t ext3 bonnie++ -d /bench/ -c 5 -s 1G -n 32 -m ext3
For ext4 fs:
fdisk /dev/sda mke2fs -t ext4 /dev/sda4 mount /dev/sda4 /bench -t ext4 bonnie++ -d /bench/ -c 5 -s 1G -n 32 -m ext4
For xfs fs:
fdisk /dev/sda /sbin/mkfs.xfs /dev/sda4 mount /dev/sda4 /bench -t xfs bonnie++ -d /bench/ -c 5 -s 1G -n 32 -m xfsTo move the mysql datadir from "/var/lib/mysql" to "/bench", by editing mysql config file("/etc/my.cnf"). Replace
#datadir = /var/lib/mysql datadir = /benchCopy mysql datafiles to new location,change the owner,start the mysql server.
cp -fr /var/lib/mysql/* /bench chown mysql:mysql /bench -R service mysqld startCreate create_table.sql scripts:
vi create_table.sqlPaste below codes.
create table testTable (text1 varchar(50),number1 int) insert into testTable (text1,number1) values ('ERf56768ZSDR4567343',7894)Create queries.sql scripts:
vi queries.sqlPaste below codes.
select * from testTableRun the mysqlslap
mysqlslap --user=root --password --concurrency=50 --iterations=500 --create=create_table.sql --query=queries.sqlRepeat above steps for different filesystems. The results: EXT3 and EXT4 were good and quite comparable, followed by XFS.
No comments :
Post a Comment