SlideShare a Scribd company logo
Caching Strategy  & APC  Vo Duy Tuan - CEO/Founder From the PHP developer view
$who_am_I? My Name is Võ Duy Tuấn PHP 5 Zend Certified Engineer Interests: PHP, Social Network, Optimize Web Works: Reader.vn CEO/Founder Trainer Freelancer Help customer Optimize & Speed up website
Caching Strategy 1
1.1. Web Caching Introduction
1.2. Cache Strategy Heavy load page/module HIT & MISS ratio. Budget & Technology AJAX SEO friendly Seperating to small tactics Cache WHERE ? Cache WHAT ? Cache HOW LONG ?
1.2.1. Cache WHERE?
1.2.2. Cache WHAT? File Code Query Result Object Array String Number …
1.2.3. Cache HOW LONG? Cache Clear Type: Never Expired Normal Expired Force Expired “ More time caching, less real time data.”
Which cache do you  HATE  most?
Alternative PHP Cache - APC 2
2.1. What is APC? Free PHP Extension PHP Opcode cache Support User data cache Run on SAME machine with PHP NOT support multi servers
 
2.2. APC Installation On linux: pecl install apc On Windows: Download apc DLL file to PHP extension directory such as  php_apc.dll
2.3. PHP.INI extension=/home/path/to/apc.so [apc] apc.enabled =  1 apc.cache_by_default= 0 apc.shm_segments=1 apc.optimization=0 apc.shm_size= 128 apc.ttl= 7200 apc.user_ttl= 7200
phpinfo()
2.4. APC Monitor
 
 
2.5. APC Using
 
2.6. APC Tip Opcode your web code only Disable APC for PhpMyAdmin <Directory &quot;/mysite/public_html/&quot;> ... php_admin_flag apc.cache_by_default  On </Directory <Directory &quot;/mysite/public_html/ phpmyadmin/ &quot;> ... php_admin_flag apc.cache_by_default  Off </Directory>
2.6. APC Tip.. Cache  STRING  is better than  ARRAY Long Time To Live better than Short Case study: Caching for Feed System:
BEFORE
BEFORE
ANALYSE
AFTER
Short TTL make fragmentation
Short TTL make fragmentation
It’s time to  query  … Thanks you!

More Related Content

PPTX
Speed up with hiphop php 2014 01-22
PPT
Heavy Web Optimization: Frontend
PPT
HTML5 CSS3 The Future of Web Technologies
PPT
PHP: Debugger, Profiler and more
PPT
Mobile for web
PPT
Build your own PHP extension
PPT
Heavy Web Optimization: Backend
PPTX
Speed up Your Joomla Site for Ultimate Performance
Speed up with hiphop php 2014 01-22
Heavy Web Optimization: Frontend
HTML5 CSS3 The Future of Web Technologies
PHP: Debugger, Profiler and more
Mobile for web
Build your own PHP extension
Heavy Web Optimization: Backend
Speed up Your Joomla Site for Ultimate Performance

What's hot (20)

PPTX
Squeeze Maximum Performance From Your Joomla Website
PPTX
Wordpress website scaling challenges
PDF
Speed Up Wordpress, Wordpress Horsepower
PDF
Wordpress horsepower
PDF
WordCamp RVA 2011 - Performance & Tuning
PPTX
WordPress Performance 101
PPTX
Presentation1
PDF
High Performance - Joomla!Days NL 2009 #jd09nl
PPT
WordPress MU 101
ODP
Optimizing Drupal Performance. Tips and Tricks
ODP
Optimizing Drupal Performance (English)
ODP
Top 10 WordPress Plugins
PPT
Mambo (2006) Presentation on CMS
ODP
Top 10 WordPress Plugins
PDF
Scale with Microservices
ODP
Front-End Performance Optimizing
PPTX
Caching WordPress - Anthony Burchell Wordcamp Presentation
PDF
DrupalCon Barcelona 2015
PPTX
Wordpress optimization
PDF
How to set up a Wordpress Blog
Squeeze Maximum Performance From Your Joomla Website
Wordpress website scaling challenges
Speed Up Wordpress, Wordpress Horsepower
Wordpress horsepower
WordCamp RVA 2011 - Performance & Tuning
WordPress Performance 101
Presentation1
High Performance - Joomla!Days NL 2009 #jd09nl
WordPress MU 101
Optimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance (English)
Top 10 WordPress Plugins
Mambo (2006) Presentation on CMS
Top 10 WordPress Plugins
Scale with Microservices
Front-End Performance Optimizing
Caching WordPress - Anthony Burchell Wordcamp Presentation
DrupalCon Barcelona 2015
Wordpress optimization
How to set up a Wordpress Blog
Ad

Viewers also liked (17)

PPTX
React introduction
PPTX
How to Build Recommender System with Content based Filtering
PDF
Chatbot in Sale Management
PPTX
Business Intelligence in Retail Industry
PPTX
Microservices and docker
PPT
Javascript unit testing framework
PPTX
Microservices in production
PPTX
Magento overview and how sell Magento extensions
PPTX
Php psr standard 2014 01-22
PPTX
How to build a Recommender System
PDF
Web performance - appliquer les règles de base
PDF
Web optimization
PDF
Zingme practice for building scalable website with PHP
PPTX
Reader.vn 2012 - The Book Of Life
ODP
Caching Strategies
PDF
Building a Recommendation Engine - An example of a product recommendation engine
PDF
Recommender system algorithm and architecture
React introduction
How to Build Recommender System with Content based Filtering
Chatbot in Sale Management
Business Intelligence in Retail Industry
Microservices and docker
Javascript unit testing framework
Microservices in production
Magento overview and how sell Magento extensions
Php psr standard 2014 01-22
How to build a Recommender System
Web performance - appliquer les règles de base
Web optimization
Zingme practice for building scalable website with PHP
Reader.vn 2012 - The Book Of Life
Caching Strategies
Building a Recommendation Engine - An example of a product recommendation engine
Recommender system algorithm and architecture
Ad

Similar to Caching strategy and apc (20)

PPT
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”
ODP
Caching and tuning fun for high scalability @ phpBenelux 2011
PDF
WordPress At Scale. WordCamp Dhaka 2019
ODP
phptek13 - Caching and tuning fun tutorial
PPTX
Caching 101
ODP
Caching and tuning fun for high scalability @ PHPTour
PPTX
AEM (CQ) Dispatcher Caching Webinar 2013
ODP
Caching and tuning fun for high scalability @ FOSDEM 2012
PDF
2013 - Dustin whittle - Escalando PHP en la vida real
ODP
Caching and tuning fun for high scalability @ FrOSCon 2011
ODP
Caching and tuning fun for high scalability
PPT
0628阙宏宇
PPT
How to? Drupal developer toolkit. Dennis Povshedny.
PPTX
AEM (CQ) Dispatcher Security and CDN+Browser Caching
ODP
Caching and tuning fun for high scalability
ODP
Introduction to APC
PPTX
Joomla! Performance on Steroids
PDF
Caching
PDF
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
PDF
php & performance
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”
Caching and tuning fun for high scalability @ phpBenelux 2011
WordPress At Scale. WordCamp Dhaka 2019
phptek13 - Caching and tuning fun tutorial
Caching 101
Caching and tuning fun for high scalability @ PHPTour
AEM (CQ) Dispatcher Caching Webinar 2013
Caching and tuning fun for high scalability @ FOSDEM 2012
2013 - Dustin whittle - Escalando PHP en la vida real
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability
0628阙宏宇
How to? Drupal developer toolkit. Dennis Povshedny.
AEM (CQ) Dispatcher Security and CDN+Browser Caching
Caching and tuning fun for high scalability
Introduction to APC
Joomla! Performance on Steroids
Caching
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
php & performance

More from Võ Duy Tuấn (10)

PPTX
Log management system for Microservices
PDF
Multi-tenant Database Design for SaaS
PPTX
Flutter introduction
PPTX
Mobile outsourcing best practices
PPT
Html5, css3 and the future of web technologies
PPT
How startups can benefit from launch community
PDF
Xây dựng mạng xã hội bằng drupal
PDF
Speed up zing me – ntvv2 code with PHP extension module
PDF
Hanoi php day 2010 program
PPT
Social network game service
Log management system for Microservices
Multi-tenant Database Design for SaaS
Flutter introduction
Mobile outsourcing best practices
Html5, css3 and the future of web technologies
How startups can benefit from launch community
Xây dựng mạng xã hội bằng drupal
Speed up zing me – ntvv2 code with PHP extension module
Hanoi php day 2010 program
Social network game service

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mushroom cultivation and it's methods.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Machine Learning_overview_presentation.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Getting Started with Data Integration: FME Form 101
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
Programs and apps: productivity, graphics, security and other tools
Mushroom cultivation and it's methods.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Univ-Connecticut-ChatGPT-Presentaion.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Per capita expenditure prediction using model stacking based on satellite ima...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Heart disease approach using modified random forest and particle swarm optimi...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine Learning_overview_presentation.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Getting Started with Data Integration: FME Form 101
TLE Review Electricity (Electricity).pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
Machine learning based COVID-19 study performance prediction
Assigned Numbers - 2025 - Bluetooth® Document
Group 1 Presentation -Planning and Decision Making .pptx

Caching strategy and apc

Editor's Notes

  • #28: Determine the existing size of your shared memory segment: sysctl -a | grep shmmax Set sysctl -w kernel.shmmax=50331648
  • #29: Determine the existing size of your shared memory segment: sysctl -a | grep shmmax Set sysctl -w kernel.shmmax=50331648