Redis memory accumulates by job process return value
See original GitHub issueUsing base use case inspired by quick start docs https://docs.bullmq.io/
const { Queue, Worker } = require('bullmq');
const someData = 'some data';
const queue = new Queue('queueName');
queue.add('index', {}, { removeOnComplete: true });
new Worker(queue.name, async job => {
return someData;
});
Every time I run the code above, the job is added to the queue and processed. Redis memory increases (at least) linearly by someData
size + some small amount.
I expect memory to decline after job is removed, which it supposedly is here - redis key bull:queueName:{id}
not present upon completion.
Redis memory: redis-cli
-> INFO MEMORY
-> “used_memory”
This code equivalent in the old ‘bull’ library seems to work as expected.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Redis memory accumulates by job process return value #366
Every time I run the code above, the job is added to the queue and processed. Redis memory increases (at least) linearly by...
Read more >Memory Optimization for Redis | Redis Documentation Center
Redis and clients are typically IO bound and the IO costs are typically at least 2 orders of magnitude in respect to the...
Read more >Memory management best practices | Memorystore for Redis
You should regularly monitor your cache-hit ratio so that you know what percentage of key lookups are successfully returned by keys in your...
Read more >MEMORY USAGE - Redis
The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM. The reported...
Read more >How we diagnosed and resolved Redis latency spikes with ...
If eviction overhead saturates the main thread's CPU, then response rate falls below request arrival rate. Redis accumulates a request backlog ( ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
drained event was saved continuously even when worker is idle, this was fixed in https://github.com/taskforcesh/bullmq/pull/1123, so I think this should be the main reason of this issue
@sspread If you could provide a test case that demonstrates the issue I can look into it. As far as I can see, we XTRIM when posting events and in my tests it works as it should.