SlideShare a Scribd company logo
How to reduce database load using
Memcache
A Ajay Kumar Reddy
https://www.drupal.org/u/ajay_reddy
● What is Memcache?
● Why do we need Memcache?
● How to install Memcache?
● How to configure Memcache in Drupal?
● Merits and demerits of Memcache.
Agendas
● Memcache is an in-memory Key-Value pairs data store.
● The Memcached server itself stores all the actual data in
area of allocated RAM on the server (configurable).
What is Memcache?
● Well, having a storage frequently in RAM uses less time
to fetch DATA.
● Can split upon Multiple applications based on
“PREFIX”.
Why do we need Memcache?
● Open the terminal on your local machine and run the following codes:
○ sudo apt-get update
○ sudo apt install memcached
○ sudo apt install php-memcached
● Make sure Memcache daemon is working fine by running the following
command:
○ “ps aux | grep memcached”
● Also, check whether the Memcached extension is properly configured
in PHP7 by creating info.php page.
How to install Memcache?
How to install Memcache?
● sudo nano /var/www/html/memcache/info.php
● And enter the below code
● <?php
phpinfo();
?>
● Now restart both Memcached and php7-fpm services
● service memcached restart
● service php7.0-fpm restart
● Go to any web browser and access info.php as
“http://localhost/memcache/info.php”.
● Download and Install Memcache and Memcache Storage
modules from drupal.org
○ drush en memcache memcache_storage -y
● Here we are using Memcache storage module to integrate
Drupal and Memcached.
● Memcache Storage module used to store data in Memcache
and also to show statistics.
How to configure Memcache in
Drupal?
Configure settings.php
● // Set’s default cache storage as Memcache and excludes
database connection for cache
$settings['cache']['default'] =
'cache.backend.memcache_storage';
● // Set’s Memcache key prefix for your site and useful in
working sites with same memcache as backend.
$settings['memcache_storage']['key_prefix'] = '';
● // Set’s Memcache storage server’s.
$settings['memcache_storage']['memcached_servers'] =
['127.0.0.1:11211' => 'default'];
How memcache works in Drupal?
● It is open source.
● Perfectly efficient for
websites with huge
database load/page
hits.
● An client server
application over TCP
and/or UDP.
Merits and Demerits of Memcache
● Loss of data is system
reboots.
● RAM usage.
● Removes least data
first.
● Shares data all over
server if not configured
with application key.
Thank you

More Related Content

PPTX
Caching in Drupal 8
PPTX
Performance Optimization in Drupal 8
PPTX
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
PDF
High Performance - Joomla!Days NL 2009 #jd09nl
PDF
WordCamp RVA 2011 - Performance & Tuning
PPTX
wordpress-performance-presentation
PPTX
Presentation1
PPTX
Web profiler in drupal 8
Caching in Drupal 8
Performance Optimization in Drupal 8
WordPress Hosting Best Practices - Do's and Don't s | WordPress Trivandrum
High Performance - Joomla!Days NL 2009 #jd09nl
WordCamp RVA 2011 - Performance & Tuning
wordpress-performance-presentation
Presentation1
Web profiler in drupal 8

What's hot (20)

PPTX
RESTful Web services in Drupal 8
PDF
Php & web server performace
PPT
PPT
Drupalcamp Estonia - High Performance Sites
PDF
23 Ways To Speed Up WordPress
PPTX
Caching 101
PPT
Drupal caching
PDF
Magento caching
PPT
Performance Optimization using Caching | Swatantra Kumar
PDF
Sofia WP User Group Presentation
PPTX
Drupal 8 and NGINX
PDF
Introduction of webpack 4
PDF
Optimize drupal
ODP
Speed kills
PPT
Memcache
PPTX
Tips To Increase The Speed Of Drupal 8 Websites
PPTX
Using memcache to improve php performance
PDF
Building low latency java applications with ehcache
PDF
Memcached: What is it and what does it do? (PHP Version)
PDF
WordCamp RVA
RESTful Web services in Drupal 8
Php & web server performace
Drupalcamp Estonia - High Performance Sites
23 Ways To Speed Up WordPress
Caching 101
Drupal caching
Magento caching
Performance Optimization using Caching | Swatantra Kumar
Sofia WP User Group Presentation
Drupal 8 and NGINX
Introduction of webpack 4
Optimize drupal
Speed kills
Memcache
Tips To Increase The Speed Of Drupal 8 Websites
Using memcache to improve php performance
Building low latency java applications with ehcache
Memcached: What is it and what does it do? (PHP Version)
WordCamp RVA
Ad

Similar to How to reduce database load using Memcache (20)

PDF
Memcache and Drupal - Vaibhav Jain
PDF
Drupal7 MEMCACHE
PPTX
Improving Website Performance with Memecached Webinar | Achieve Internet
PPTX
Improving Website Performance with Memecached Webinar | Achieve Internet
PDF
Improving Website Performance and Scalability with Memcached
PDF
Memcache - Lightning fast object retrieval
PPTX
ODP
Caching and tuning fun for high scalability
ODP
phptek13 - Caching and tuning fun tutorial
PDF
Caching
PDF
Cache all the things - A guide to caching Drupal
PDF
Give Your Site a Boost with Memcache
PPTX
Scalling web applications using memcache
PDF
Caching for Cash: Caching
ODP
Caching and tuning fun for high scalability
PDF
Jeff Rigby on Scaling Drupal in the Enterprise
PPT
Drupalcamp Estonia - High Performance Sites
ODP
Caching and tuning fun for high scalability @ FrOSCon 2011
ODP
Caching and tuning fun for high scalability
PPTX
Caching
Memcache and Drupal - Vaibhav Jain
Drupal7 MEMCACHE
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance and Scalability with Memcached
Memcache - Lightning fast object retrieval
Caching and tuning fun for high scalability
phptek13 - Caching and tuning fun tutorial
Caching
Cache all the things - A guide to caching Drupal
Give Your Site a Boost with Memcache
Scalling web applications using memcache
Caching for Cash: Caching
Caching and tuning fun for high scalability
Jeff Rigby on Scaling Drupal in the Enterprise
Drupalcamp Estonia - High Performance Sites
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability
Caching
Ad

More from valuebound (20)

PDF
Scaling Drupal for High Traffic Websites
PDF
Drupal 7 to Drupal 10 Migration A Fintech Strategic Blueprint (1).pdf
PDF
How to Use DDEV to Streamline Your Drupal Development Process.
PDF
How to Use AWS to Automate Your IT Operation| Valuebound
PDF
How to Use Firebase to Send Push Notifications to React Native and Node.js Apps
PDF
Mastering Drupal Theming
PDF
The Benefits of Cloud Engineering
PDF
Cloud Computing
PDF
The Future of Cloud Engineering: Emerging Trends and Technologies to Watch in...
PDF
Deep dive into ChatGPT
PDF
Content Creation Solution | Valuebound
PPTX
Road ahead for Drupal 8 contributed projects
PPTX
Chatbot with RASA | Valuebound
PDF
Drupal and Artificial Intelligence for Personalization
PPTX
Drupal growth in last year | Valuebound
PPTX
BE NEW TO THE WORLD "BRAVE FROM CHROME"
PPTX
Event loop in browser
PPTX
The Basics of MongoDB
PPTX
React JS: A Secret Preview
PPTX
Dependency Injection in Drupal 8
Scaling Drupal for High Traffic Websites
Drupal 7 to Drupal 10 Migration A Fintech Strategic Blueprint (1).pdf
How to Use DDEV to Streamline Your Drupal Development Process.
How to Use AWS to Automate Your IT Operation| Valuebound
How to Use Firebase to Send Push Notifications to React Native and Node.js Apps
Mastering Drupal Theming
The Benefits of Cloud Engineering
Cloud Computing
The Future of Cloud Engineering: Emerging Trends and Technologies to Watch in...
Deep dive into ChatGPT
Content Creation Solution | Valuebound
Road ahead for Drupal 8 contributed projects
Chatbot with RASA | Valuebound
Drupal and Artificial Intelligence for Personalization
Drupal growth in last year | Valuebound
BE NEW TO THE WORLD "BRAVE FROM CHROME"
Event loop in browser
The Basics of MongoDB
React JS: A Secret Preview
Dependency Injection in Drupal 8

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Understanding_Digital_Forensics_Presentation.pptx
MYSQL Presentation for SQL database connectivity
sap open course for s4hana steps from ECC to s4
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

How to reduce database load using Memcache

  • 1. How to reduce database load using Memcache A Ajay Kumar Reddy https://www.drupal.org/u/ajay_reddy
  • 2. ● What is Memcache? ● Why do we need Memcache? ● How to install Memcache? ● How to configure Memcache in Drupal? ● Merits and demerits of Memcache. Agendas
  • 3. ● Memcache is an in-memory Key-Value pairs data store. ● The Memcached server itself stores all the actual data in area of allocated RAM on the server (configurable). What is Memcache?
  • 4. ● Well, having a storage frequently in RAM uses less time to fetch DATA. ● Can split upon Multiple applications based on “PREFIX”. Why do we need Memcache?
  • 5. ● Open the terminal on your local machine and run the following codes: ○ sudo apt-get update ○ sudo apt install memcached ○ sudo apt install php-memcached ● Make sure Memcache daemon is working fine by running the following command: ○ “ps aux | grep memcached” ● Also, check whether the Memcached extension is properly configured in PHP7 by creating info.php page. How to install Memcache?
  • 6. How to install Memcache? ● sudo nano /var/www/html/memcache/info.php ● And enter the below code ● <?php phpinfo(); ?> ● Now restart both Memcached and php7-fpm services ● service memcached restart ● service php7.0-fpm restart ● Go to any web browser and access info.php as “http://localhost/memcache/info.php”.
  • 7. ● Download and Install Memcache and Memcache Storage modules from drupal.org ○ drush en memcache memcache_storage -y ● Here we are using Memcache storage module to integrate Drupal and Memcached. ● Memcache Storage module used to store data in Memcache and also to show statistics. How to configure Memcache in Drupal?
  • 8. Configure settings.php ● // Set’s default cache storage as Memcache and excludes database connection for cache $settings['cache']['default'] = 'cache.backend.memcache_storage'; ● // Set’s Memcache key prefix for your site and useful in working sites with same memcache as backend. $settings['memcache_storage']['key_prefix'] = ''; ● // Set’s Memcache storage server’s. $settings['memcache_storage']['memcached_servers'] = ['127.0.0.1:11211' => 'default'];
  • 9. How memcache works in Drupal?
  • 10. ● It is open source. ● Perfectly efficient for websites with huge database load/page hits. ● An client server application over TCP and/or UDP. Merits and Demerits of Memcache ● Loss of data is system reboots. ● RAM usage. ● Removes least data first. ● Shares data all over server if not configured with application key.