gpt4 book ai didi

yugabyte-db - 接口(interface)连接限制配置

转载 作者:行者123 更新时间:2023-12-04 03:03:57 26 4
gpt4 key购买 nike

我遇到了 YEDIS 接口(interface)到 yugabyte 的连接限制(或者可能是内部 rpc 连接限制)。

此限制约为 800 个同时连接。一段时间后,以下内容会引发错误:

java -jar ./yb-sample-apps.jar \
--workload RedisKeyValue \
--nodes 127.0.0.1:6379 \
--nouuid \
--value_size 256 \
--num_threads_read 0 \
--num_threads_write 800 \
--num_unique_keys 1000000000

错误如下所示:
tablet: f9b5581437774f97979c868e283c628d, num_ops: 1, num_attempts: 5, txn: 00000000-0000-0000-0000-000000000000) passed its deadline 57037.830s (passed: 3.851s

但这似乎运行良好 indefinetly:
java -jar ./yb-sample-apps.jar \
--workload RedisKeyValue \
--nodes 127.0.0.1:6379 \
--nouuid \
--value_size 256 \
--num_threads_read 0 \
--num_threads_write 500 \
--num_unique_keys 1000000000

如何提高连接限制?或者这是一个错误?对于我的应用程序来说,800 个连接还远远不够。我的应用程序最多可以同时连接 8,000 个连接。

据我所知,我的 ulimit 设置很好:
[root@72c14ca48af1 yugabyte]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 29892
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1048576
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

最佳答案

感谢您报告此问题,以及 YugaByte 松弛 channel 上的额外输入以帮助隔离问题。

原来这里有两个问题:

a) 当一个 yb-tserver是自己启动的,它假设它可以使用 85% 的系统 RAM(这是可配置的),但是 yb-ctl默认情况下,启动测试集群的方式只为 yb-tserver 进程提供 1GB 的 RAM。

b) 对于redis连接,每个连接的固定开销为1MB。因此,在大约 8000 个连接时,这种开销本身将需要大约 8GB 的​​内存。这由 redis_rpc_block_size 控制。 yb-tserver gflag,默认为 1MB。

由于这两个因素,对系统的写入被拒绝并出现以下错误:

I0624 21:32:28.317205  6772 maintenance_manager.cc:341] we have exceeded our soft memory limit (current capacity is 136.82%).  However, there are no ops currently runnable which would free memory.

以下覆盖应该解除阻止您的工作负载:
 ./yb-ctl destroy
./yb-ctl start --disable_ysql --tserver_flags="redis_rpc_block_size=131072,memory_limit_hard_bytes=6000000000"
./yb-ctl setup_redis

以上 memory_limit_hard_bytes ~6GB 的值假设您有一台 8GB 的​​机器。请注意,yb-master 的内存要求并不太高。

关于yugabyte-db - 接口(interface)连接限制配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56727844/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com