Python memcached set_多存储问题

Python memcached set_多存储问题,python,memcached,python-memcached,Python,Memcached,Python Memcached,我在尝试使用python memcached存储大量密钥时发现了一个问题。 以下是我正在做的: import memcache # This dict has a 2270 entries that is generated on production server v = eval(open("/home/dragoon/output").read()) a = memcache.Client(['unix:/tmp/memcached.sock'], debug=1) 接下来,我将尝试设

我在尝试使用python memcached存储大量密钥时发现了一个问题。 以下是我正在做的:

import memcache

# This dict has a 2270 entries that is generated on production server
v = eval(open("/home/dragoon/output").read())
a = memcache.Client(['unix:/tmp/memcached.sock'], debug=1)
接下来,我将尝试设置所有这些值:

In [94]: len(a.set_multi(v))                                       
MemCached: MemCache: unix:/tmp/memcached.sock: timed out.  Marking dead.
Out[94]: 2270
memcached服务器的日志输出:

...
27: going from conn_new_cmd to conn_parse_cmd
<27 set d750bde63a98579f9c2987907aaaf5f8 1 0 18
27: going from conn_parse_cmd to conn_nread
> FOUND KEY d750bde63a98579f9c2987907aaaf5f8
>27 STORED
27: going from conn_nread to conn_write
Failed to write, and not due to blocking: Broken pipe
27: going from conn_write to conn_closing
<27 connection closed.
默认超时时间为3秒,但即使将其增加到100秒也无济于事,memcached只是被卡住了。 所以,我的问题是,memcache有什么问题


我看到人们在谈论在其中存储超过10万条条目,但对我来说,它甚至不能存储2000条?

好的。memcached 1.4.2是Ubuntu10.04 LTS的最后一个版本,它似乎有一些bug。
Memcached 1.4.5运行良好。

尝试使用pylibmc作为memcache驱动程序,而不是使用python memcache


我在Ubuntu 11上的Memcache 1.4.7上也看到过这个问题。

不幸的是,我们仍然使用django 1.2,所以pylibmc现在不是一个选项(错误也会发生,Memcached版本1.4.13,本机API(telnet)作为客户端,php/pear Memcached作为客户端驱动程序。。。
In [96]: len(a.set_multi({'test':1}))
Out[96]: 0

In [97]: a.get('test')
Out[97]: 1