【发布时间】:2020-04-28 05:06:02
【问题描述】:
我们正在对 Apache Ignite 进行负载测试。
我们有1个DB服务器和1个tomcat的App服务器。
两台机器都有这个设置。
CPU Intel I7
Speed 2.6Ghz
Cores 4
Ram 16GB
Disk 500GB
配置->
App server Java Heap -> Xms512m, Xmx3072m.
DB server Java Heap -> Xms512m, Xmx3072m.
DB server persistence -> true
DB server Offheap Max size -> 3072m.
Write throttling enabled.
Client failure detection timeout set to 10000ms
Failure detection timeout set to 30000ms
Query thread pool size is the default -> 8
场景->
通过 tomcat App 服务器,我启动了 500 个线程,这些线程运行一个业务逻辑来设置和从 Ignite 获取数据。在代码方面,缓存访问存在信号量锁定,并且线程通常处于阻塞状态,因为其他线程正在使用资源。运行 3-4 小时后,应用服务器已抛出如下警告。
"org.apache.ignite.logger.java.JavaLogger" "warning" "WARNING" "" "294" "Communication SPI session write timed out (consider increasing 'socketWriteTimeout' configuration property) [remoteAddr=xxxxx/xxxxx:47100, writeTimeout=2000]" "" "" "" "" "" "" "" "" "" "" "" "" "" "ROOT" "{""service"":""xxxx"",""logger_name"":""org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi""}"
我还看到很多“可能太长的 JVM”打印,然后打印显示大约 500 毫秒到 1000 毫秒的延迟。
execption 抛出后,几分钟后,客户端断开连接,查询抛出此错误 ->
org.apache.ignite.internal.IgniteClientDisconnectedCheckedException: Query was canceled, client node disconnected.
虽然它运行良好,但我启用 JProfiler 只是为了查看它在 App 服务器 JVM 中的运行情况,并且我可以看到很多线程处于“阻塞”状态。而且由于它是 4 核机器,我可以看到一次最多执行 12-15 个应用服务器线程(使用逻辑内核)。然后退出分析器,让它运行 2-3 小时,直到发生异常。
尽管在实时情况下,我们不会产生那么多线程,而在生产中,我们将在服务器上拥有 100 多个内核,但了解如何设置可扩展的部署以满足需求对我们来说很重要需要产生许多线程。
谁能解释一下?
【问题讨论】:
标签: java multithreading ignite gridgain