如何减少docker运行时的kworker IO?

问题描述 投票:0回答:2

我是码头工人的新手。我想为 sybase ASE/IQ 创建一个 docker 映像。这些天我遇到了一些问题—— 当数据库引擎执行IO时,主机上总是有更多由kworker线程生成的更高的额外IO。它严重影响 IO 性能。我找不到解决方案。请好心指教。 详细内容如下--

我正在使用来自 docker hub 的 sles11 映像 - https://hub.docker.com/r/darksheer/sles11sp4 - 并在其容器上安装了 Sybase ASE 15.7。然后,当我创建数据库服务器时,我发现 --

 1. The srvbuildres command runs very slow -- usually it only takes 3-5 minutes to finish on host, but it takes 1.5h to complete on the docker container.
 2. I used "top -d 1" and "iostat -x -k 1" to check IO busy -- found the io_wait is always low , but the svctm are high -- it means the IO is very slow.
 3. I use pidstat to trace the IO request on the host , and found -- most IOs were consumed by kworker threads --



Here's a sample while I creating a small test database on docker container -- 

08:06:05      UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay  Command
08:06:06     1105     66252      0.00     16.00      0.00       0  dataserver
08:06:06        0     66528      0.00      0.00      0.00       1  kworker/2:2
08:06:06        0     66574      0.00   2400.00      0.00       0  kworker/1:0
08:06:06        0     66584      0.00     96.00      0.00       0  kworker/u256:1

08:06:06      UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay  Command
08:06:07        0     65159      0.00    720.00      0.00       0  kworker/u256:7
08:06:07     1105     66252      0.00    112.00      0.00       0  dataserver
08:06:07        0     66528      0.00  11696.00      0.00       2  kworker/2:2
08:06:07        0     66530      0.00  14368.00      0.00       0  kworker/3:1
08:06:07        0     66573      0.00   4768.00      0.00       0  kworker/0:2
08:06:07        0     66574      0.00   4960.00      0.00       1  kworker/1:0
08:06:07        0     66584      0.00    848.00      0.00       0  kworker/u256:1

08:06:07      UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay  Command
08:06:08        0     65159      0.00   2304.00      0.00       0  kworker/u256:7
08:06:08     1105     66252      0.00    208.00      0.00       0  dataserver
08:06:08        0     66528      0.00  18464.00      0.00       0  kworker/2:2
08:06:08        0     66530      0.00  20608.00      0.00       1  kworker/3:1
08:06:08        0     66573      0.00   2256.00      0.00       0  kworker/0:2
08:06:08        0     66574      0.00  18256.00      0.00       0  kworker/1:0
08:06:08        0     66584      0.00    192.00      0.00       0  kworker/u256:1

The IO of kworker is much higher than the DB process -- "dataserver", and made the "create database" completed in 5minutes. And I made a same test on the host out of the container, the pidstat shows --

eisen-suse11:~ # pidstat -d 1
Linux 3.0.101-63-default (eisen-suse11)         01/19/22        _x86_64_
13:30:07          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
13:30:08          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
13:30:09          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
13:30:10         4860      0.00      4.00      0.00  isql

13:30:10          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
13:30:11         4845    404.00    404.00      0.00  dataserver

13:30:11          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
13:30:12          PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command

因此,如果没有 kworker,相同的“创建数据库”命令只需 1 秒即可完成...... 我找不到文档,只找到了如何限制kworker的CPU/内存/GPU资源-- https://docs.docker.com/config/containers/resource_constraints/ -- 但没有关于IO的评论调谐。 请好心人帮忙。预先感谢您的任何想法。

问候 艾森

docker io sles
2个回答
1
投票

找出答案—— 是因为btrfs...一旦使用ext3/ext4来包含DB设备文件,IO性能就很好。


0
投票

我也有同样的问题。请告诉我如何实现ext3/ext4。

© www.soinside.com 2019 - 2024. All rights reserved.