测试Redis过程中的小问题总结

Redis测试过程中的小问题总结 :

1,如果想禁止数据写入磁盘,需要关注配置文件中的以下三项:
(1)
# after 60 sec if at least 10000 keys changed
#
# Note: you can disable saving at all commenting all the "save" lines.

save 900 1
save 300 10
save 60 10000
上面的三个是触发同步到磁盘操作的条件,直接屏蔽即可

(2)
# IMPORTANT: Check the BGREWRITEAOF to check how to rewrite the append
# log file in background when it gets too big.

appendonly no

此处不需要修改


(3)
# If unsure, use "everysec".

# appendfsync always
#appendfsync everysec
appendfsync no


2,error: ‘struct head’ has no member named ‘list’
之前自己运行的时候代码都是OK的,加入到Redis之后就有问题了,所以首先排除了基本的语法问题。
最后发现是由于编译的时候GCC的设置的问题 ,具体原因如下:
代码中使用了类似
struct head
{
...
union {
struct { struct head*prev, *next; } list;
...
} ;
};
的结构 ,这样的语法在GCC默认情况下是没问题的,但是按照C99的标准就有问题,修改后问题解决



posted on 2012-05-14 14:30  aitilang  阅读(191)  评论(0编辑  收藏  举报

导航