|
4 | 4 | import com.netease.nim.camellia.core.constant.CamelliaVersion; |
5 | 5 | import com.netease.nim.camellia.core.util.ReadableResourceTableUtil; |
6 | 6 | import com.netease.nim.camellia.redis.proxy.command.Command; |
| 7 | +import com.netease.nim.camellia.redis.proxy.conf.ProxyDynamicConf; |
7 | 8 | import com.netease.nim.camellia.redis.proxy.netty.GlobalRedisProxyEnv; |
8 | 9 | import com.netease.nim.camellia.redis.proxy.upstream.IUpstreamClientTemplateFactory; |
9 | 10 | import com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientTemplate; |
|
21 | 22 | import com.netease.nim.camellia.redis.proxy.util.ErrorLogCollector; |
22 | 23 | import com.netease.nim.camellia.redis.proxy.util.Utils; |
23 | 24 | import io.netty.util.concurrent.DefaultThreadFactory; |
| 25 | +import org.slf4j.Logger; |
| 26 | +import org.slf4j.LoggerFactory; |
24 | 27 |
|
25 | 28 | import java.lang.management.*; |
26 | 29 | import java.nio.charset.StandardCharsets; |
|
36 | 39 | */ |
37 | 40 | public class ProxyInfoUtils { |
38 | 41 |
|
39 | | - private static final ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, |
40 | | - new LinkedBlockingQueue<>(8), new DefaultThreadFactory("proxy-info")); |
| 42 | + private static final Logger logger = LoggerFactory.getLogger(ProxyInfoUtils.class); |
| 43 | + |
| 44 | + private static final ThreadPoolExecutor executor; |
| 45 | + static { |
| 46 | + int poolSize = ProxyDynamicConf.getInt("info.command.executor.pool.size", 1); |
| 47 | + int queueSize = ProxyDynamicConf.getInt("info.command.executor.queue.size", 128); |
| 48 | + executor = new ThreadPoolExecutor(poolSize, poolSize, 0, TimeUnit.SECONDS, |
| 49 | + new LinkedBlockingQueue<>(queueSize), new DefaultThreadFactory("proxy-info")); |
| 50 | + logger.info("init info command executor, pool.size = {}, queue.size = {}", poolSize, queueSize); |
| 51 | + } |
41 | 52 |
|
42 | 53 | public static final String VERSION = CamelliaVersion.version; |
43 | 54 | public static final String RedisVersion = "7.0.11"; |
|
0 commit comments