Chen Kinnrot
Chen Kinnrot

Reputation: 21015

ruby method caching performance

I'm using the cache_method gem, and while profiling some critical process in my app I found the following result

 6.11    0.01    0.00    6.10    413/413    ActiveSupport::Cache::Strategy::LocalCache#write_entry  364
 4.70    0.01    0.00    4.69    388/388    ActiveSupport::Cache::Strategy::LocalCache#delete_entry

Is it possible that for 413 cache write and 388 cache delete it takes 10 seconds? sound way too much. Any way to improve this with some configuration options?

Upvotes: 2

Views: 125

Answers (1)

Belkacem REBBOUH
Belkacem REBBOUH

Reputation: 559

It's perfectly possible that these operations take so long to achieve, the first symptom is indexing, while updating your cache you are certainly updating your indexes and this is the heaviest task in caching mechanism. You can take a look in your index configuration, and depending in its implementation you can use lazy index refresh to avoid latency in Delete and Update operations. Cheers

Upvotes: 2

Related Questions