Lots of Dalli objects #288

Closed
bcarpenter opened this Issue Nov 13, 2012 · 6 comments

Comments

Projects
None yet
3 participants

I'm not sure if this is expected behavior or not, but it seems like our rails app is instantiating many dalli objects. Here is the output from one of our debug emails (there are actually many more of these repeating, but I've truncated the paste):

rack.session.options => {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :memcache_server=>["sjcache01:11211", "sjcache02:11211", "sjcache03:11211"], :namespace=>"cart_sessions_v1_production", :username=>"sessions", :expires_in=>7200, :socket_timeout=>0.25, :down_retry_delay=>60, :compress=>true, :compression=>true, :cache=>#7200, :namespace=>"cart_sessions_v1_production", :username=>"sessions", :socket_timeout=>0.25, :compress=>true, :compression=>true, :down_retry_delay=>60}, @Ring=#60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>], @continuum=[#60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>, #60, :socket_timeout=>0.25, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :username=>"sessions", :password=>nil, :async=>false, :expires_in=>7200, :namespace=>"cart_sessions_v1_production", :compress=>true, :compression=>true}, @sock=#, @msg=nil, @lock=#>, @Version="1.7.1_6_gd5076d9", @error=nil>>,

Is this normal dalli behavior?

Collaborator

mperham commented May 27, 2013

How many memcached servers do you have? What does your config look like?

Running 3x Membase 1.7.2r servers (each running Ubuntu 10.04 w/10GB RAM). Membase runs moxi + memcached under the hood.

/opt/membase/bin/memcached -h shows, among other things, the following version info:
memcached 1.4.4_461_gf99c147

Gemfile has the following (I notice it's a really old version of dalli):
gem 'dalli', '1.1.5'

Do you suggest upgrading to Dalli 2.6.4 first, or to try debugging this issue with the current setup?

Collaborator

mperham commented May 29, 2013

I can't really support v1 anymore. Please try latest.

On 28 May 2013, at 18:05, Ben Carpenter notifications@github.com wrote:

Running 3x Membase 1.7.2r servers (each running Ubuntu 10.04 w/10GB RAM). Membase runs moxi + memcached under the hood.

/opt/membase/bin/memcached -h shows, among other things, the following version info:
memcached 1.4.4_461_gf99c147

Gemfile has the following (I notice it's a really old version of dalli):
gem 'dalli', '1.1.5'

Do you suggest upgrading to Dalli 2.6.4 first, or to try debugging this issue with the current setup?


Reply to this email directly or view it on GitHub.

Contributor

inspire22 commented Jun 17, 2013

I'm getting the same thing with Dalli 2.6.4.

My errors that get saved to the database show 307 instances of Dalli::Ring::Entry> All are identical

Curse github's removal of html tags, here's it without the alligator bracket:

Dalli::Ring::Entry:0xa0c137c @value=684278687, @server=# Dalli::Server:0xa0f4c2c @hostname="thorn.allpoetry.com", @port=11211, @weight=1, @fail_count=0, @down_at=nil, @last_down_at=nil, @options={:down_retry_delay=>1, :socket_timeout=>0.5, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :compressor=>Dalli::Compressor, :compression_min_size=>1024, :compression_max_size=>false, :serializer=>Marshal, :username=>nil, :password=>nil, :keepalive=>true, :namespace=>"rack:session", :path=>"/", :domain=>nil, :expire_after=>30 days, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :memcache_server=>["my_servers"], :secret=>"secret"}, @sock=#Dalli::Server::KSocket:fd 17>, @msg=nil, @error=nil, @pid=31910, @inprogress=false, @lock=#Monitor:0xa0a83e0 @mon_owner=nil, @mon_count=0, @mon_mutex=#Mutex:0xa0a83b8>>, @Version="1.4.14">>,

Dalli::Ring::Entry:0xa0b548c @value=690229475, @server=# Dalli::Server:0xa0f4c2c @hostname="thorn.allpoetry.com", @port=11211, @weight=1, @fail_count=0, @down_at=nil, @last_down_at=nil, @options={:down_retry_delay=>1, :socket_timeout=>0.5, :socket_max_failures=>2, :socket_failure_delay=>0.01, :value_max_bytes=>1048576, :compressor=>Dalli::Compressor, :compression_min_size=>1024, :compression_max_size=>false, :serializer=>Marshal, :username=>nil, :password=>nil, :keepalive=>true, :namespace=>"rack:session", :path=>"/", :domain=>nil, :expire_after=>30 days, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :memcache_server=>["my_servers"], :secret=>"secret"}, @sock=#Dalli::Server::KSocket:fd 17>, @msg=nil, @error=nil, @pid=31910, @inprogress=false, @lock=#Monitor:0xa0a83e0 @mon_owner=nil, @mon_count=0, @mon_mutex=#Mutex:0xa0a83b8>>, @Version="1.4.14">>,

Thanks!

Collaborator

mperham commented Jun 17, 2013

Yes, the ring will contains lots of references to the same three servers. This is normal.

mperham closed this Jun 17, 2013

Contributor

inspire22 commented Jun 17, 2013

It's causing my exception logging to be extremely large when doing a request.inspect. Any tips for truncating it before inspecting or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment