databendlabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.74k stars 739 forks source link

bug: long time insert make databend-query oom #5002

Closed wubx closed 2 years ago

wubx commented 2 years ago

Search before asking

Version

MySQL [(none)]> select version(); +-----------------------------------------------------------------------------------------+ | @@version() | +-----------------------------------------------------------------------------------------+ | 8.0.26-v0.7.25-nightly-f25c349-simd(rust-1.61.0-nightly-2022-04-22T02:59:35.191371298Z) | +-----------------------------------------------------------------------------------------+ 1 row in set (0.002 sec)

What's Wrong?

use sysbench test to prepare data get OOM

[962131.939547] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-2.scope,task=databend-query,pid=3538476,uid=1000 [962131.940172] Out of memory: Killed process 3538476 (databend-query) total-vm:39948408kB, anon-rss:14528620kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:39280kB oom_score_adj:0 [962132.317804] oom_reaper: reaped process 3538476 (databend-query), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

How to Reproduce?

install sysbench: https://github.com/akopytov/sysbench

cat env.sh

#DBIP='172.16.16.12'
DBIP='192.168.2.10'
DBPORT=3307
DBUSER='wubx'
DBPASSWD='wubxwubx'
NOW=`date +'%Y%m%d%H%M'`
DBNAME="wubx"
REPORT_INTERVAL=1
TBLCNT=10
WARMUP=300
ROWS=10000000
thread=10
T=900
events=200000000

cat prepare.sh source ./env.sh

sysbench /usr/local/share/sysbench/oltp_read_write.lua  \
             --mysql-host=$DBIP \
             --mysql-port=$DBPORT \
             --mysql-user=$DBUSER \
             --mysql-password=$DBPASSWD \
             --mysql-db=$DBNAME \
             --tables=$TBLCNT \
             --table-size=$ROWS \
             --create_secondary=false \
             --report-interval=$REPORT_INTERVAL \
             --threads=${thread} \
             --reconnect=0 \
             --db-ps-mode=disable \
             --skip_trx=0 \
             --auto_inc=0 \
             --time=$DURING prepare

./prepare.sh

Are you willing to submit PR?

wubx commented 2 years ago

other ways use : https://github.com/TCeason/test

./bench8028 --thread-nums=10 --max-allowed-thread-nums=100 --host=127.0.0.1 --user=root --password=root --port=3307 --batch-rows=1000 --total-rows=10000000

sundy-li commented 2 years ago

I think it's fixed after #6354