Skip to content

[Bug]: tke regression :sysbench bulk_insert 1000threads test cn and dn oom #15201

Closed

Description

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

6e2ff3c

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

测试环境:128服务器,64c/256G
测试场景:sysbench bulk_insert批量数据插入测试,并发1000
测试结果:sysbench bulk_insert thread 1000在运行到300s快结束时内存涨到98%,一直不释放(bulk_insert 100threads时测试正常,没有oom情况)

[github@mo-srv-128 mo-sysbench]$ sysbench --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable bulk_insert.lua --mysql-db=sysbench_db --tables=10 --table_size=1000000 --threads=1000 --time=300 --report-interval=10 --range_selects=off --point_selects=1 run
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1000
Report intermediate results every 10 second(s)
Initializing random number generator from current time

Initializing worker threads...

Threads started!

[ 10s ] thds: 1000 tps: 3985006.44 qps: 42.80 (r/w/o: 0.00/42.80/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 1000 tps: 3997982.11 qps: 71.83 (r/w/o: 0.00/71.83/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 1000 tps: 2917418.92 qps: 81.10 (r/w/o: 0.00/81.10/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 1000 tps: 3812933.18 qps: 111.68 (r/w/o: 0.00/111.68/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 1000 tps: 2113941.85 qps: 64.52 (r/w/o: 0.00/64.52/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 1000 tps: 1579320.65 qps: 48.20 (r/w/o: 0.00/48.20/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 70s ] thds: 1000 tps: 976428.32 qps: 29.80 (r/w/o: 0.00/29.80/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 80s ] thds: 1000 tps: 1500685.87 qps: 45.80 (r/w/o: 0.00/45.80/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 1000 tps: 1124284.81 qps: 34.40 (r/w/o: 0.00/34.40/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 100s ] thds: 1000 tps: 1480610.13 qps: 45.10 (r/w/o: 0.00/45.10/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 110s ] thds: 1000 tps: 848639.94 qps: 25.90 (r/w/o: 0.00/25.90/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 1000 tps: 1359978.78 qps: 41.60 (r/w/o: 0.00/41.60/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 130s ] thds: 1000 tps: 1199031.96 qps: 36.50 (r/w/o: 0.00/36.50/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 140s ] thds: 1000 tps: 445625.09 qps: 13.60 (r/w/o: 0.00/13.60/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 150s ] thds: 1000 tps: 1058343.24 qps: 32.30 (r/w/o: 0.00/32.30/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 160s ] thds: 1000 tps: 458678.91 qps: 14.00 (r/w/o: 0.00/14.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 170s ] thds: 1000 tps: 943657.11 qps: 28.80 (r/w/o: 0.00/28.80/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 180s ] thds: 1000 tps: 792994.45 qps: 24.20 (r/w/o: 0.00/24.20/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 190s ] thds: 1000 tps: 1266270.01 qps: 38.90 (r/w/o: 0.00/38.90/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 200s ] thds: 1000 tps: 1223911.06 qps: 37.10 (r/w/o: 0.00/37.10/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 210s ] thds: 1000 tps: 1218959.57 qps: 37.20 (r/w/o: 0.00/37.20/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 220s ] thds: 1000 tps: 1369619.70 qps: 41.80 (r/w/o: 0.00/41.80/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 230s ] thds: 1000 tps: 1100615.59 qps: 33.60 (r/w/o: 0.00/33.60/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 240s ] thds: 1000 tps: 993125.51 qps: 30.30 (r/w/o: 0.00/30.30/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 250s ] thds: 1000 tps: 1389278.58 qps: 42.40 (r/w/o: 0.00/42.40/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 260s ] thds: 1000 tps: 1376159.42 qps: 42.00 (r/w/o: 0.00/42.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 270s ] thds: 1000 tps: 946944.23 qps: 28.90 (r/w/o: 0.00/28.90/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 280s ] thds: 1000 tps: 1363067.80 qps: 41.60 (r/w/o: 0.00/41.60/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 290s ] thds: 1000 tps: 1310638.75 qps: 40.00 (r/w/o: 0.00/40.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 300s ] thds: 1000 tps: 1310640.10 qps: 40.00 (r/w/o: 0.00/40.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 310s ] thds: 1000 tps: 18.00 qps: 18.00 (r/w/o: 0.00/18.00/0.00) lat (ms,95%): 30469.90 err/s: 0.00 reconn/s: 0.00
[ 320s ] thds: 1000 tps: 27.80 qps: 27.80 (r/w/o: 0.00/27.80/0.00) lat (ms,95%): 33946.25 err/s: 0.00 reconn/s: 0.00
[ 330s ] thds: 1000 tps: 17.30 qps: 17.30 (r/w/o: 0.00/17.30/0.00) lat (ms,95%): 38506.38 err/s: 0.00 reconn/s: 0.00
[ 340s ] thds: 1000 tps: 15.60 qps: 15.60 (r/w/o: 0.00/15.60/0.00) lat (ms,95%): 41382.17 err/s: 0.00 reconn/s: 0.00
[ 350s ] thds: 1000 tps: 2.40 qps: 2.40 (r/w/o: 0.00/2.40/0.00) lat (ms,95%): 54214.49 err/s: 0.00 reconn/s: 0.00
[ 360s ] thds: 1000 tps: 2.50 qps: 2.50 (r/w/o: 0.00/2.50/0.00) lat (ms,95%): 63752.41 err/s: 0.00 reconn/s: 0.00
[ 370s ] thds: 1000 tps: 1.10 qps: 1.10 (r/w/o: 0.00/1.10/0.00) lat (ms,95%): 71026.01 err/s: 0.00 reconn/s: 0.00
[ 380s ] thds: 1000 tps: 1.30 qps: 1.30 (r/w/o: 0.00/1.30/0.00) lat (ms,95%): 83521.57 err/s: 0.00 reconn/s: 0.00
[ 390s ] thds: 1000 tps: 1.80 qps: 1.80 (r/w/o: 0.00/1.80/0.00) lat (ms,95%): 89759.24 err/s: 0.00 reconn/s: 0.00
[ 400s ] thds: 1000 tps: 0.30 qps: 0.30 (r/w/o: 0.00/0.30/0.00) lat (ms,95%): 96462.77 err/s: 0.00 reconn/s: 0.00
[ 410s ] thds: 1000 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 420s ] thds: 1000 tps: 0.10 qps: 0.10 (r/w/o: 0.00/0.10/0.00) lat (ms,95%): 100000.00 err/s: 0.00 reconn/s: 0.00
[ 430s ] thds: 1000 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 440s ] thds: 1000 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 451s ] thds: 1000 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 460s ] thds: 1000 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00
[ 470s ] thds: 1000 tps: 0.00 qps: 0.00 (r/w/o: 0.00/0.00/0.00) lat (ms,95%): 0.00 err/s: 0.00 reconn/s: 0.00

运行到300s后mo-service资源使用情况,cpu基本占满,导致服务器无法连接登录,测试了两次都是一样的现象
企业微信截图_f7cab00b-f6d3-4b64-8786-c9ddb9e87500
运行到400s时内存使用情况:
[root@mo-srv-128 ~]# free -m
total used free shared buff/cache available
Mem: 257392 256336 632 20 423 781
Swap: 19999 19999 0
[root@mo-srv-128 ~]# free -m
total used free shared buff/cache available
Mem: 257392 256364 609 17 418 758
Swap: 19999 19999 0

sbtest表schema:
CREATE TABLE sbtest1 (
id INT NOT NULL,
k INT DEFAULT '0',
PRIMARY KEY (id)
)

mo toml配置:
toml.tar.gz
`cn:
service-type = "CN"
data-dir = "./mo-data"

[log]
level = "info"

[cn]
uuid = "dd1dccb4-4d3c-41f8-b482-5251dc7a41bf"
port-base = 18000

[cn.txn]
enable-leak-check = 1
max-active-ages = "2h"

[[fileservice]]
name = "LOCAL"
backend = "DISK"

[[fileservice]]
name = "SHARED"
backend = "DISK"
data-dir = "mo-data/s3"

[fileservice.cache]
memory-capacity = "32GB"
disk-capacity = "8GB"
disk-path = "mo-data/file-service-cache"
disk-min-evict-interval = "7m"
disk-evict-target = 0.8

[[fileservice]]
name = "ETL"
backend = "DISK-ETL"
`

Expected Behavior

No response

Steps to Reproduce

1.使用mo-sysbench测试工具:https://github.com/matrixorigin/mo-sysbench.git
2. cd sysbench执行以下命令
sysbench bulk_insert 命令:
sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable  bulk_insert.lua --mysql-db=sysbench_db --tables=10 --table_size=1000000 --threads=1000 --time=300 --report-interval=10 --range_selects=off --point_selects=1 prepare
sysbench  --mysql-host=127.0.0.1 --mysql-port=6001 --mysql-user=dump --mysql-password=111 --db-ps-mode=disable  bulk_insert.lua --mysql-db=sysbench_db --tables=10 --table_size=1000000 --threads=1000 --time=300 --report-interval=10 --range_selects=off --point_selects=1 run

Additional information

No response

Activity

  1. ghost added
    kind/bug
    on Mar 27, 2024
  2. ghost added
    severity/s0
    on Mar 27, 2024
  3. ghost added this to the 1.2.0 milestone on Mar 27, 2024
  4. sukki37 commented on Mar 29, 2024

    @sukki37
    Contributor
    image image

    last gc log:
    gc 58 @523.221s 2%: 0.25+4656+0.31 ms clock, 16+235/74447/169465+20 ms cpu, 232580->236203->147538 MB, 247313 MB goal, 18 MB stacks, 0 MB globals, 64 P

  5. gouhongshen commented on Apr 3, 2024

    @gouhongshen
    Contributor

    处理其他 s-1

  6. gouhongshen commented on Apr 8, 2024

    @gouhongshen
    Contributor

    处理其他 s-1

  7. gouhongshen commented on Apr 11, 2024

    @gouhongshen
    Contributor

    没有进展,在做其他issue

  8. gouhongshen commented on Apr 14, 2024

    @gouhongshen
    Contributor

    与 tn 相关占用巨大内存的地方有两个:

    1. dequeuePreparing -> MutIndex 建立内存索引
    2. HandleRowsInsert

    初步看来主要原因是由于 flush 不及时导致,没有及时清理内存中的数据。

    增快 flush 频率,可以避免 OOM

  9. 42 remaining items

  10. w-zr commented on Jul 24, 2024

    @w-zr
    Contributor

    一个优化merge 内存占用的pr合进main了 我最近测一下

  11. assigned and unassigned on Jul 31, 2024
  12. w-zr commented on Jul 31, 2024

    @w-zr
    Contributor

    已经不会oom了

  13. ghost closed this as completedon Aug 7, 2024
  14. matrix-meow commented on Aug 7, 2024

    @matrix-meow
    Contributor

    Hello @heni02. The bug issue in the BVT test code has not been removed,issues automatically open.

  15. ghost closed this as completedon Sep 20, 2024
  16. matrix-meow commented on Sep 20, 2024

    @matrix-meow
    Contributor

    Hello @heni02. The bug issue in the BVT test code has not been removed,issues automatically open.

  17. added a commit that references this issue on Sep 20, 2024
  18. ghost closed this as completedon Sep 29, 2024
  19. added a commit that references this issue on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugseverity/s0

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions