dro62273 2019-06-10 22:09
浏览 177

为什么Laravel Cache外观如此之慢?

So I switched over from using Laravel's eager loading to checking the cache first before hitting the db. I've got it to the point where it's only doing 8 queries to the database per request vs the 100+ queries it was using before.

However, the response time is now slower than it was before. Per this stackoverflow question, Laravel Caching with Redis is very slow, it seems that using the cache facade is a lot slower than calling redis/memcached directly.

Why is the cache facade slower than calling the cache directly? Should I switch over to using redis/memcached directly? What can I do to improve the performance of my application while still using the cache facade, if possible?

Leveraging caching as much as possible and minimizing the number of queries to the DB is a requirement for this project I'm working on.

Another thing to note is that I'm using both memcached and redis for the cache drivers, as there are some things that are stored in memcached that are shared between the services I'm writing and the old services, and there are items that are exclusive to the services I'm writing which I can use Redis for instead.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 arduino控制ps2手柄一直报错
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥85 maple软件,solve求反函数,出现rootof怎么办?
    • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题
    • ¥15 Visual Studio问题
    • ¥20 求一个html代码,有偿
    • ¥100 关于使用MATLAB中copularnd函数的问题