4. Type of caches
• Opcode Cache : APC, eAccelerator, Wincache, Xcache
• Query Result cache : Memcache, Redis
• CDNs : Content Delivery Networks
19/12/11
5. APC
• APC : Alternative PHP Cache
• That heavily optimizes and tunes the output of the PHP bytecode compiler and stores
the final, compiled result in shared memory.
• This bytecode optimization leads to faster runtime execution since source files do not
need to be recompiled
• re-use the compiled code rather than having to retrieve the opcodes from a disk cache,
• 3x increase in page generation speed
19/12/11
7. Memcache
•
•
•
•
Key Value pair
Slabs, pages, chunks
A slab class is a collection of pages divided into same sized chunk.
Each slab class has one or more pages, The page is of a predefined size (default
1MB). So, depending on the chunk size each page has a certain number of chunks
and some space left over wasted
• LRU is rescue : When memory gets full, so no pages can be created, the LRU (Least
Recently Used) algorithm kicks in.
19/12/11
9. CDNs
• A content delivery network or content distribution network (CDN)
• large distributed system of servers deployed in multiple data centers
across the Internet
• The goal of a CDN is to serve content to end-users with high availability
and high performance.
• CDN serves : static files like js, css, images, text files
19/12/11