You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Moneta 1.4.1, and noticed that when using Moneta::Pool with the ttl option, the pool management thread will start busy-looping after the ttl interval, thus using 100% of a CPU core. I'm using Moneta with the Redis adapter, and I've seen this behavior in Ruby version 2.7.0p0, 2.7.2p137, and 3.0.0p0.
With the moneta and redis gems installed, and a Redis server running, I can reproduce this with the following script:
#!/usr/bin/env ruby
require 'moneta'
cache = Moneta.build do
use(:Pool, min: 2, max: 4, ttl: 5, timeout: 2) do
adapter :Redis, url: "redis://127.0.0.1:6379", expires: 300
end
end
# Query the cache (It doesn't matter if this exists or not.)
puts cache[42].inspect
# Sleep 15 seconds. After 5 seconds, busy-loop will start.
sleep(15)
The text was updated successfully, but these errors were encountered:
@simmons I believe I have the issue fixed in #198 - I'm just trying to sort out the broken CI situation before I merge. In the meantime though, you might want to try out that branch for yourself to see if it fixes the issue for you.
I'm using Moneta 1.4.1, and noticed that when using
Moneta::Pool
with thettl
option, the pool management thread will start busy-looping after thettl
interval, thus using 100% of a CPU core. I'm using Moneta with the Redis adapter, and I've seen this behavior in Ruby version2.7.0p0
,2.7.2p137
, and3.0.0p0
.With the
moneta
andredis
gems installed, and a Redis server running, I can reproduce this with the following script:The text was updated successfully, but these errors were encountered: