Closed salkhwlani closed 5 years ago
Thanks for submitting this in detail! I will take a further look into this, hopefully this weekend. :)
I can confirm - I found the same thing by analyzing the cache misses and that it is looking for the cooldown data even if it isn't there.
Are we able to add this to the config file somehow?
I may write up a PR if I have some time.
Yes, a PR would help out tremendously. I haven't had a chance to analyze this issue yet. :(
@mikebronner Just added - let me know what you think. The tests are failing somewhere before my tests run so not sure what's going wrong there.
Says:
1) GeneaLabs\LaravelModelCaching\Tests\Integration\CachedBuilder\WhereJsonContainsTest::testWithInUsingCollectionQuery
Illuminate\Database\QueryException: SQLSTATE[08006] [7] timeout expired (SQL: select tablename from pg_catalog.pg_tables where schemaname = 'public')
Hi @yemenifree and @mycarrysun, would you guys mind testing release 0.4.10 to see if that fixes it? Please see the updated readme for enabling cache cool-down if you wish to use it. If not, you shouldn't have to make any changes. Please keep me updated as to how your performance testing goes. Thanks for all your help!
@mycarrysun I have updated the cachecooldown property on models to reflect seconds instead of a boolean, as we discussed yesterday.
Awesome! What version is this in?
Closing this issue for now. Please let me know if there is still a performance impact! Thanks for your guys's help on this!
Sorry for the late reply - just upgraded to 0.4.11 and is working as expected!
@mycarrysun Awesome! Thanks for following up. :)
Describe the bug
I was testing the performance of the website with a huge number of requests in sametime but I found very critical issue with performance because of
checkCooldownAndRemoveIfExpired
functionits increase the response time from < 1s to > ~9s for each request when the server tried to serve > 400 requests per second, my test was done using different settings and using load balance for the web server and cache servers
after removing
checkCooldownAndRemoveIfExpired
from source code and use only model cache the server serves more than 2000 request per second without any issues or effect in response timeby the way, I don't use
cool-down
in my codeEnvironment
Perfomrnace with
checkCooldownAndRemoveIfExpired
Perfomance without
checkCooldownAndRemoveIfExpired