Web Application Cache (APC, Memcache)

11
Web Application Caching

description

This presentation is on the basics of web application cache. With the opcode cache, memcache, CDNs....

Transcript of Web Application Cache (APC, Memcache)

Page 1: Web Application Cache (APC, Memcache)

 

Web Application Caching

Page 2: Web Application Cache (APC, Memcache)

19/12/11

• Web application caching is the process of storing dynamically generated data for reuse and leaving data closer to the end user.

• Caching used to store static & dynamic data. • For static (js, images, css) there are different kind of caching mechanism used,

CDN : akamai, maxcdn, • For application File, object cache opcode cache get used : APC, eaccelarator,

wincache, xcache• For dynamic data caching Memcache, Redis,

What is Caching?

Page 3: Web Application Cache (APC, Memcache)

19/12/11

• To improve web application performance• To minimize the requests to the server• Even small performance improvements from caching can drastically

improve the user experience.• Reduced server workload can translate to reduced hardware and support

costs.

Why to use Caching?

Page 4: Web Application Cache (APC, Memcache)

19/12/11

• Opcode Cache : APC, eAccelerator, Wincache, Xcache• Query Result cache : Memcache, Redis• CDNs : Content Delivery Networks

Type of caches

Page 5: Web Application Cache (APC, Memcache)

19/12/11

• 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

APC

Page 6: Web Application Cache (APC, Memcache)

19/12/11

APC

Page 7: Web Application Cache (APC, Memcache)

19/12/11

• 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.

Memcache

Page 8: Web Application Cache (APC, Memcache)

19/12/11

Memcache

Page 9: Web Application Cache (APC, Memcache)

19/12/11

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

Page 10: Web Application Cache (APC, Memcache)

19/12/11

CDNs

Page 11: Web Application Cache (APC, Memcache)

19/12/11

Thank You