为redis设置的命令需要永远

时间:2014-12-04 05:22:54

标签: python flask redis debian

我正在尝试在我的烧瓶应用程序中使用pyredis。

我有以下python代码:

r_server = Redis()
p = r_server.pipeline()                 

r_server.set('test_key', 'testdsokdksodksdoe')                       
print 'previous set key ' + r_server.get('test_key')
p.execute()

redis-server正在记录以下内容:

[19083] 03 Dec 21:15:38.537 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:15:38.537 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:15:43.550 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:15:43.551 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:15:48.564 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:15:48.564 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:15:53.576 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:15:53.576 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:15:58.586 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:15:58.586 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:16:03.597 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:16:03.598 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:16:08.609 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:16:08.609 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:16:13.621 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:16:13.621 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:16:18.633 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:16:18.634 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:16:23.648 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:16:23.648 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:16:28.662 - DB 0: 1 keys (0 volatile) in 4 slots HT.
[19083] 03 Dec 21:16:28.662 - 0 clients connected (0 slaves), 366680 bytes in use
[19083] 03 Dec 21:16:30.521 - Accepted 127.0.0.1:48944
[19083] 03 Dec 21:16:30.522 - Client closed connection

所以你可以看到设置密钥几乎需要一分钟。为什么会这样?

我正在运行Debian Wheezy。 Redis版本是:2.8.17

0 个答案:

没有答案