简体   繁体   中英

What type of cache better to use to improve performance of website?

I have high-load informative website with 10 000+ hits/day. It was rewritten on Symfony 2 Framework with Doctrine2 ORM . Site have heavy informative pages, each load on development server 0.5 - 1.5 seconds approximately. Note, that it time on development server , so it has minimal load.

I know there are many cache providers such as Varnish, Memcached, APC, HTTP, etc... Please, suggest me on what layer ( DB , HTTP , etc...) and what type of cache better to use for improve performance of this site?

Like @Mark said in the comment, " there is no best answer to such an open-ended question ". At first, let's find the what : which component is the system bottleneck, DB, HTTP response, javascript...?

And in each component, there are other questions:

  • DB : Which queries slow the system down (Hint: using Log Slow Query)? Can we refator those? (This is often the key factor, given that it's informative website) What is the result of MySQL Explain or other alternatives?
  • HTTP response : Does it take unreasonably much time to transport rendered content to client machine? (Hint: using Web Developer Tools or even cUrl). Does it load the static files over and over again without utilizing the HTTP cache? Does using Nginx caching help?
  • Javascript : Are there any scripts that block browser from rendering the page? Are there any errors caused by conflicts of scripts (which will add up the waiting time for sure)?

....

Let's have the checklist, which list those questions <--> answers. The answer for " what type of cache better to use for improve performance of this site " TOTALLY DEPENDS on those.

Somewhere to reference:

And I recommend a very very good book: Scale PHP Application , in which you can learn real use cases, how to debug, how to profile..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM