简体   繁体   English

Pyignite:尝试使用 put_all() 将 json 加载到缓存中时出现连接超时错误

[英]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.

相关问题 从 python 瘦客户端调用 put_all 时出错 - get error on calling put_all from python thin client 如何使用 pyignite 访问我的 ignite 缓存 - How do I access my ignite cache using pyignite 插座连接与pyignite断开 - Socket connection broke with pyignite 尝试在Python中加载Japense字符时,Json返回错误? - Json returning an error when trying to load Japense characters in Python? 尝试使用 json 加载时出现 Json 解码器错误。 - Json Decoder Error while trying to load using json.load inPython 尝试使用python中的套接字连接到服务器进行下一次连接时发生错误 - error when trying to connect to server for next the connection using sockets in python 在 docker compose 中使用 MongoDB 的连接超时错误 - Connection timeout error using MongoDB in docker compose 尝试使用 Python Paramiko 建立 SSH 连接时出现“getaddrinfo”错误 - "getaddrinfo" error when trying to establish an SSH connection using Python Paramiko 使用python suds连接到Microsoft CRM时,为什么会出现连接错误/超时? - Why do I get a connection error / timeout when using python suds to connect to Microsoft CRM? 超过了锁定等待超时; 尝试使用python更新mysql表时尝试重新启动事务'错误 - Lock wait timeout exceeded; try restarting transaction' error when trying to update mysql table using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM