0

我们想在同上处理大量的事情。所以我的问题是:有没有办法批量创建/读取/更新/删除?我写了一个测试,更新了同上事物的 10.000 个特性,这花费了 2 分钟以上。我认为这主要是发出 10.000 个 HTTP 请求而不是 MongoDB 性能的结果——批量操作可以解决这个问题。

提前致谢

   Thomas
4

2 回答 2

2

Eclipse Ditto 当前不支持批量更新。如果这是您的要求,我建议在 Eclipse Ditto 存储库中打开一个问题,可以在其中进行讨论。

如果您想摆脱 10.000 次握手(每个 http 请求)的开销,您还可以切换协议并使用 websockets 或 Eclipse Ditto 的连接 API。这应该已经提供了性能改进。

于 2021-04-19T06:32:08.953 回答
0

这是我的结果:

REST1: 2000 things created, 0 things rejected, in 67.496 seconds -> 29.6 create/s
REST1: 2000 things' features created, 0 features rejected, in 54.492 seconds -> 36.7 features/s
REST1: 20000 things' features updated, 0 updates rejected, in 523.521 seconds -> 38.2 updates/s
REST1: 993 results of 2000 by search, in 1.788 seconds -> 555.3 results/s
REST1: 2000 things deleted, in 50.861 seconds -> 39.3 deletes/s
REST32: 2000 things created, 0 things rejected, in 22.779 seconds -> 87.8 create/s
REST32: 2000 things' features created, 0 features rejected, in 20.654 seconds -> 96.8 features/s
REST32: 20000 things' features updated, 0 updates rejected, in 187.385 seconds -> 106.7 updates/s
REST32: 968 results of 2000 by search, in 1.918 seconds -> 504.7 results/s
REST32: 2000 things deleted, in 19.617 seconds -> 102.0 deletes/s
WEBSOCKET: 2000 things created w websocket, in 33.082 seconds -> 60.5 create/s
WEBSOCKET: 2000 features created, in 33.119 seconds -> 60.4 creates/s
WEBSOCKET: 20000 features modified, in 263.630 seconds -> 75.9 mods/s
WEBSOCKET: 2000 things deleted w websocket, in 24.360 seconds -> 82.1 deletes/s

REST1 结果来自 1 个线程的 ThreadWorker Pool,REST32 池有 32 个线程,并行触发 32 个请求。

最好的托马斯

于 2021-05-02T11:36:15.880 回答