【问题标题】:Mariadb 10 Throughput bottleneckMariadb 10 吞吐量瓶颈
【发布时间】:2016-01-05 08:03:48
【问题描述】:

我有一台带有 WD WD500LPLX (7200 RPM 500GB) 2.5" HDD 的 Intel Atom C2758 (8Core) 机器。操作系统是带有 MariaDB 10(默认配置)的 Ubuntu 15.10(内核 4.2)

我每秒插入大约 20-30 行(行大小为 355 字节)。看起来瓶颈在于 HDD IO,但 wMB/s 低且利用率高。 我还能做些什么来使它需要更多的交易。

谢谢。

与:

iostat -m -x 1

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.50    0.00    0.50   12.20    0.00   86.79

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00    22.00    0.00   61.00     0.00     0.39    12.98     1.00   15.74    0.00   15.74  16.13  98.40

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.50    0.00    0.00   12.31    0.00   87.19

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00    24.00    0.00   68.00     0.00     0.45    13.53     0.99   14.71    0.00   14.71  14.24  96.80

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.75    0.00    0.50   12.31    0.00   86.43

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda               0.00    27.00    0.00   75.00     0.00     0.48    13.12     1.02   13.71    0.00   13.71  12.91  96.80

【问题讨论】:

    标签: performance mariadb throughput


    【解决方案1】:

    INSERT 太慢了?

    • innodb_flush_log_at_trx_commit = 2 速度更快,但安全性稍差。
    • “批量”插入:INSERT ... VALUES (...), (...) ... 或使用 LOAD DATA

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-06
      • 1970-01-01
      • 2016-11-08
      • 2020-04-10
      • 2013-03-23
      • 2016-08-05
      • 2018-06-25
      • 1970-01-01
      相关资源
      最近更新 更多