[英]Pyignite: connection timeout error when trying to load json into cache using put_all()
The code works when tried with fewer values but gives connection timeout error when tried with even 30k entries.该代码在尝试使用较少值时有效,但在尝试使用 30k 条目时会出现连接超时错误。
Sample code with sample json:带有示例 json 的示例代码:
a = {}
for i in range(10000):
a.update({"test"+str(i):((MapObject.HASH_MAP,
{"key_1": ((1,["value_1",1.0]),MapObject),
"key_2": ((1, [["value_2_1","1.0"],["value_2_2","0.25"]]),CollectionObject),
"key_3": ((1, [["value_3_1","1.0"],["value_3_2","0.25"]]),CollectionObject),
"key_4": ((1, [["value_4_1","1.0"],["value_4_2","0.25"]]),CollectionObject),
'key_5': False,
"key_6":"value_6"}),MapObject)})
test_cache.put_all(a)
Tried this试过这个
a = {}
for i in range(10000):
a.update({"test" + str(i): ((MapObject.HASH_MAP,
{"key_1": ((1, ["value_1", 1.0]), CollectionObject),
"key_2": ((1, [["value_2_1", "1.0"], ["value_2_2", "0.25"]]), CollectionObject),
"key_3": ((1, [["value_3_1", "1.0"], ["value_3_2", "0.25"]]), CollectionObject),
"key_4": ((1, [["value_4_1", "1.0"], ["value_4_2", "0.25"]]), CollectionObject),
'key_5': False,
"key_6": "value_6"}), MapObject)})
start = time.time()
cache.put_all(a)
print(f'duration {time.time() - start}')
on master branch -- works as expected, took about 7 sec.在 master 分支上——按预期工作,大约需要 7 秒。 to complete against 4 ignite nodes on average laptop.在普通笔记本电脑上完成 4 个 ignite 节点。 We will release 0.4.0
soon, stay tuned!我们即将发布0.4.0
,敬请期待!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.