您好,最近我在两个不同的 ubuntu 服务器上进行了测试。
Here are the results:
innodb_flush_trx_commit = 1
Staging Server: 10,000 Inserts ----> 81 seconds
innodb_flush_trx_commit = 2
Staging Server: 10,000 Inserts ----> 61 seconds
Dev Server:
innodb_flush_trx_commit = 1
10,000 Inserts ----> 5 seconds
Dev Server:
innodb_flush_trx_commit = 2
10,000 Inserts ----> 2 seconds
I am clear that performance vary with innodb_flush setting.
But why there is a huge diff in performance from the server to server ?
这里需要考虑哪些事情......? 以下是一些考虑过的细节,但没有什么值得怀疑的:
staging server: Intel(R) Xeon(R) CPU X5355 @2.66GHz
processor 0, 1
mysql 5.1.61
innodb_buffer_pool : 8MB
RAM: 4GB
dev server: AMD Opteron(tm) Processor 4130 @2.60ghZ
processor 0, 1
mysql 5.0.67
innodb_buffer_pool : 8MB
RAM: 4GB
请帮助理解到底是什么导致了不同服务器上性能的巨大差异......?
NOTE: same script used in the same way on noth the servers and not from remote
sesrvers.
提前致谢。 问候, 乌迪
最佳答案
我会遇到的一些问题...
是否在一个实例上启用了二进制日志记录,而在另一个实例上未启用?
登台服务器是否使用网络驱动器来访问 mysql 数据?
两台服务器上的文件系统类型是否相同(ext3、ext2 等)?
磁盘事件似乎是罪魁祸首。
关于mysql - 为什么 INSERT 性能存在这种差异......?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10008866/