php - When to use memcached -


How can I find out how the memorycat works you use it to improve the site's performance to store part of the data We do. When you want to retrieve some data, you check that in the first memcatch, if it is, you will retrieve it, otherwise you will check your database / filesystem etc.

I just do not know how / when to use it? What would be a good chance?

I have the following applause:

Author:

ID user name email password salt email_salt email_verified ip_address < P> Author_threads:

thread_id, author_id

thread:

created id, title, content,

Tags:

ID, name

thread_tag:

tad_id, thread_id

I want to select the latest 30 threads, their authors and all their tags. This is the SQL statement I use:

  thread, thread. Thread_id by thread_tags as thread tags, thread.id = thread_tags.thread_id, tag by thread_tags as thread, thread content, author_id, author_id, GROUP_CONCAT (DISTINCT tag.name ORDER), by tag.name DESC SEPARATOR ',') Add tags to thread_tags.tag_id = tag.id Include author_threads on thread. Author = Author_Thread Author at Thread_Id Author Join Author_threads.author_id = Author.id Group by Thread.ID DESC Sirius 0, 30   

This is PHP I use:

  function get_latest_threads ($ link, $ start) {$ start = minimal_int ($ start); Tagged thread by thread as $ thread = sql_select ($ link, "yarn as thread, thread .id, author, author, author.id as author_id, GROUP_CONCAT (DINIT tag for tag .name order,) Include thread.id = thread_tags.thread_id thread_tags but include thread_tags.tag_id = tag.id tag but include thread.id = author_threads.thread_id author_threads but author_threads.author_id = author.id joins author by group thread.id DESC LIMIT $ Starts, 30 "#I just want to get 30 records every time); Return $ threads; }   

Where / how are memcached to be used here?

How do I know / just do not know when to use it?

It is used only once proved that you can get to boost the best performance There is a complex application that can highlight a large number of microscopic worms and bizarre behavior, caching any kind of caching or output caching was not being added.

Find out if your code has real performance issues, identify and fix the barriers that include fine caching, then it collects the first evidence . , but

Comments