使用python-memcached==1.48
终端:
memcached -I 10mPython:
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import memcache
>>> mc = memcache.Client(['127.0.0.1:11211'], debug=0)
>>> print(mc.set('test', ''.join(['a' for x in xrange(1*1024*1024+1)])))
0
>>> print(mc.set('test', ''.join(['a' for x in xrange(1*1024*1024)])))
True实际上,有没有人能复制这个?
发布于 2013-04-07 04:15:23
您必须告诉python-memcache最大值大小是多少,它才会接受大于1MB的值:
import memcache
mc = memcache.Client(['127.0.0.1:11211'],
debug = 0,
server_max_value_length = 1024*1024*10
)https://stackoverflow.com/questions/15853950
复制相似问题