fastentry icon indicating copy to clipboard operation
fastentry copied to clipboard

Performance issues

Open hmatic opened this issue 5 years ago • 13 comments

We're experiencing performance issues when using this gem.

We have built rails app only using this gem as cache dashboard.

On staging where cache store is not that big, it's working fine, but in production where we have bigger cache it's crashing every few clicks, even on instance with alot of resources.

Is this something you're aware of? Is there anything we're doing wrong or gem is lacking performance on bigger cache stores?

hmatic avatar May 27 '19 06:05 hmatic

Hi @hmatic, thanks for getting in touch. What cache store are you using? And approximately how many entries do you have in production? There are teams using Fastentry in production with thousands of entries and it performs well.

alvesjtiago avatar May 27 '19 09:05 alvesjtiago

We're using memcached and we have approx 470k entries.

hmatic avatar May 27 '19 10:05 hmatic

Thanks for the info @hmatic. Let me take a look and try to reproduce locally with a heavier load of entries.

You mentioned that it's crashing every few clicks. What kind of crashes are you experiencing? Also, is it related to a particular action?

alvesjtiago avatar May 27 '19 10:05 alvesjtiago

We're running it on AWS ECS inside docker containers. For example on container with 512cpu/1024memory it could only load initial dashboard, after trying to change page, it simply crashed container. When I increased it to 1024/2048, it's not longer crashing, but it's extremely slow. Loading single entry is ok, but all "index" actions are really slow.

hmatic avatar May 27 '19 10:05 hmatic

Got it, that's very helpful. I'll try to reproduce and mitigate the performance issues.

alvesjtiago avatar May 27 '19 10:05 alvesjtiago

Quick question @hmatic, are you using Rails 5 or 4?

alvesjtiago avatar May 28 '19 14:05 alvesjtiago

Rails 5.2

hmatic avatar May 28 '19 14:05 hmatic

@hmatic could you try with version on branch optimize-cache-access?

To install please add this to the gemfile: gem 'fastentry', :git => "git://github.com/alvesjtiago/fastentry.git", :branch => "optimize-cache-access" and run bundle install.

I've made some improvements to minimize access to memcached directly.

alvesjtiago avatar May 28 '19 15:05 alvesjtiago

@hmatic were you able to test this? Let me know when you get a chance to try it and if it fixes the issue for you.

alvesjtiago avatar May 30 '19 15:05 alvesjtiago

@alvesjtiago sorry, I'll be able to test it tomorrow

hmatic avatar May 30 '19 16:05 hmatic

No problem at all @hmatic. Thanks

alvesjtiago avatar May 30 '19 17:05 alvesjtiago

This did not help at all :(

I have even managed to crash app while clicking through pages.

hmatic avatar May 31 '19 12:05 hmatic

Ok @hmatic, I'll continue investigating. Unfortunately with memcached it might not be possible to go through every key without indexing them with another system. For now, I'd recommend not using Fastentry with memcached in production for large datasets. I'll add a note to the repo.

alvesjtiago avatar Jun 01 '19 17:06 alvesjtiago