Redis with Ruby

Redis with Ruby

資料


-redis | RubyGems.org | your community gem host
--https://rubygems.org/gems/redis

-redis/redis-rb: A Ruby client library for Redis
--https://github.com/redis/redis-rb

-File: README - Documentation for redis
--http://www.rubydoc.info/gems/redis/

close 処理


-QUIT - Redis
--https://redis.io/commands/quit
-->Ask the server to close the connection. The connection is closed as soon as all pending replies have been written to the client.

-接続処理 - redis 2.0.3 documentation
--http://redis.shibu.jp/commandreference/connection.html#command-QUIT
-->QUIT()
-->サーバに対して、コネクションを静かにクローズするように依頼します。

-lua-hiredisでcloseしているのにnetstatで確認するとTIME_WAITが大量発生していた件 | blog.fukata.org
--https://blog.fukata.org/archives/7452
-->どうもうまくredisとのコネクションが切れていなかったので、lua-hiredisのclose処理を見てみるとredisのquitコマンドは発行していなかったので、試しに、closeの前にquitコマンドを発行してみることにしました。
-->するとTIME_WAITが大量に発生することなく、abで大量にアクセスしてみてもredisへ接続出来なくなるという現象も発生せず安定するようになりました。