mysql - 为什么 INSERT 性能存在这种差异......?

标签 mysql performance insert

您好,最近我在两个不同的 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/

相关文章:

java - 为什么会无限循环? ( java )

mysql - 从选择查询结果中插入数据并添加新列

php/mysql事务

mysql - 规范化现有多列、多字符串表的最佳方法?

php - 如果另一个表中存在值,则从表中选择全部

php - 使用 PHP 查询访问 3 个不同选项卡的 MySql 数据库

c++ - 逐行读取文件与读取整个文件时的性能

performance - php-fpm slowlog 第一个字段是什么意思?

performance - 当有单独的链接与列表链接时,为什么我们在哈希表中使用线性探测?

MySqlDataReader 在构建时给出错误