File access speed vs database access speed

后端 未结 4 1706
忘了有多久
忘了有多久 2020-12-13 10:01

The site I am developing in php makes many MySQL database requests per page viewed. Albeit many are small requests with properly designed index\'s. I do not know if it will

4条回答
  •  被撕碎了的回忆
    2020-12-13 10:44

    From plain performance perspective, it is wiser to tune the database server and not complicate the data access logic with intermediate file caches. A good database server would do the caching on its own if the results are cacheable. (I'm not sure what is teh case with mysql).

    If you have performance problems, you should profile the pages to see the real bottlenecks. Even when you are -like me- a fan of the optimized codes, putting a stronger/more hardware into the equation is cheaper on the long run.

    If you still need to use caches, consider using an existing solution, like memcached.

提交回复
热议问题