Magento caching
Click here to load reader
-
Upload
yireo -
Category
Technology
-
view
2.593 -
download
1
description
Transcript of Magento caching
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Magento Caching
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
About PHP accelerators
PHP is an interpreted language. The PHP interpreter converts PHP to bytecode. A PHP engine can cache interpreted bytecode into memory (or on the filesystem) by using a PHP accelerator (aka opcode cacher).
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
PHP accelerators - listing
Zend Optimizer+Built into PHP 5.5; Optional in PHP 5.4
APCStandard opcode cacher under PHP 5.3 and PHP 5.4
Obsolete: Xcache
eAccelerator
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
PHP accelerators - tips
Using Zend Optimizer+PHP 5.5: Enabled by default
PHP 5.4: Perhaps faster than APC > benchmark for yourself
Using APCMake sure APC cache is large enough
Make sure TTL is set and not 0
Set apc.stat = 0 if PHP-files don't change anymore
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Magento cache / session handlers (1/2)
File (folder /var/cache)Tip: Store in tmpfs / RAM-disk
Database
APC (Advanced PHP Cache)or APCu (APC userland) under PHP 5.5)
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Magento cache / session handlers (2/2)
memcachedDistributed caching system
Run through UNIX socket and not TCP/IP socket
Redis (recommended)Dstributed caching system
Cm_RedisSession extension / Cm_Cache_Backend_Redis
Run through UNIX socket and not TCP/IP socket
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Zend TwoLevel Cache
Fast cache backendOptions: APC, memcached, file
Slow cache backendOptions: Files, database, memcached, apc
Ment for management of tags, when fast cache does not
In practiceWhen memcached is used (fast cache), /var/cache is still used (slow cache)
When Redis is used (fast cache), /var/cache stays empty (no slow cache)
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Magento caching - tips
Use Redis instead of memcacheBypass Two Level Cache issue (and keep /var/cache empty)
Optimize “files” backend (/var/cache)When small enough, use RAM disk or tmpfs
When larger, use Cm_Cache_Backend_File for more subfolders
When even larger, switch to other caching backend (preferred: Redis)
Larger cacheBeware of a cache being too large (>10Gb). Caching might become pointless.
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Magento FPC (Full Page Cache)
Magento Enterprise Edition (Enterprise_PageCache)
Lesti::FPCFree and very flexible
Make sure to configure Layered Navigation properly (especially sliders)
Zoom Full-Page CacheFree and a bit faster than Lesti::FPC
No updates since Magento CE 1.8
A JAX calls for lazy loading
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Issues with FPC
Cold cache is slowPrewarm the cache by using site crawlers
Wrong content is displayedHole punching not configured properly
Make sure to check for proper caching of A JAX calls
Session data shared between customersOnly cache non-session specific data
Optionally use customer specific cache (Lesti: “lazy blocks”)
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Reverse proxy
NginxAlso native Nginx caching (fastcgi cache)
No hole punching, no cache purging
SSL support
VarnishMagento extension Turpentine
Hole punching support via VCL (Varnish Control Language)
Cache purging via varnishadm (shell)
No SSL support
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Yireo server configuration
Nginx / PHP-FPMversion 1.6: SPDY
FastCGI page caching
PHP-FPM through socket, not TCP/IP
PHP 5.4Zend OPC, not APC
Magento + Redis cache
MySQL InnoDB tuning
Presentation “Magento Caching” - http://slideshare.net/yireoJisse Reitsma ([email protected]) - Twitter @yireo
Yireo Stuff
DisableLogDisable all Magento logging
ProfilerLogGather profiling statistics over time (plus nice graphs in Magento backend)
Magento Performance InsightsPending: Web-based in summer 2014