我们有来自REST的200万个对象,每个API调用中有500个对象块(总计750 MB的数据)。
有你们推荐的优化吗?我想知道为什么黑兹尔卡斯特会给CPU增加这么多。
FYI -认为vertx.executeBlocking是异步执行一段代码。我们正在使用英特尔Xeon 8核心CPU与12 We。
发布于 2017-08-14 19:05:09
看看IMap.putAll。它允许将数据放入块中。你说200万除以500个对象= 4k块
/**
* {@inheritDoc}
* <p>
* No atomicity guarantees are given. It could be that in case of failure
* some of the key/value-pairs get written, while others are not.
* </p>
* <p>
* <p><b>Warning:</b></p>
* If you have previously set a TTL for the key, the TTL remains unchanged and the entry will
* expire when the initial TTL has elapsed.
* </p>
*/
void putAll(Map<? extends K, ? extends V> m);发布于 2017-08-17 12:33:54
有你们推荐的优化吗?
您可以尝试使用IMap.setAsync而不是IMap.putAsync,根据文档,它应该更有效:
类似于put操作,但set不返回旧值,这样效率更高。
https://stackoverflow.com/questions/45680328
复制相似问题