Home > Article > Backend Development > php redis有关问题
php redis问题
查阅了一下资料关于redis的,connect连接,quit的话就关闭连接。
但是php的redis貌似只有连接函数,没有关闭函数。
难道不需要关闭么?这样的话过多的连接岂不是会导致redis变慢,还是它有自己的回收机制?那这个是在什么时候断开连接的呢?
------解决方案--------------------
From my findings, if your clients are calling a local Redis instance where connections are really cheap (i.e. essentially a No Op) then connection pooling is actually slower then creating a new connection every time. However in the normal scenario where your clients are calling a networked Redis instance I've found connection pooling improves perf by about 8-14%.
https://groups.google.com/forum/?fromgroups=#!topic/redis-db/QQdp11TL2_g
这个之前有人讨论过,希望这个帖子对你有帮助。
------解决方案--------------------
php可以不需要关心关闭这一动作,它与memcache、mysql机制不太一样。