SlideShare uma empresa Scribd logo
1 de 11
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

Mais conteúdo relacionado

Mais procurados

Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
Tuyển Đoàn
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
drupalcampest
 
Drupal caching
Drupal cachingDrupal caching
Drupal caching
Exove
 
Performance Optimization using Caching | Swatantra Kumar
Performance Optimization using Caching | Swatantra KumarPerformance Optimization using Caching | Swatantra Kumar
Performance Optimization using Caching | Swatantra Kumar
Swatantra Kumar
 

Mais procurados (20)

RESTful Web services in Drupal 8
RESTful Web services in Drupal 8RESTful Web services in Drupal 8
RESTful Web services in Drupal 8
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
 
Ui perf
Ui perfUi perf
Ui perf
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress
 
Caching 101
Caching 101Caching 101
Caching 101
 
Drupal caching
Drupal cachingDrupal caching
Drupal caching
 
Magento caching
Magento cachingMagento caching
Magento caching
 
Performance Optimization using Caching | Swatantra Kumar
Performance Optimization using Caching | Swatantra KumarPerformance Optimization using Caching | Swatantra Kumar
Performance Optimization using Caching | Swatantra Kumar
 
Sofia WP User Group Presentation
Sofia WP User Group PresentationSofia WP User Group Presentation
Sofia WP User Group Presentation
 
Drupal 8 and NGINX
Drupal 8 and NGINX Drupal 8 and NGINX
Drupal 8 and NGINX
 
Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4
 
Optimize drupal
Optimize drupalOptimize drupal
Optimize drupal
 
Speed kills
Speed killsSpeed kills
Speed kills
 
Memcache
MemcacheMemcache
Memcache
 
Tips To Increase The Speed Of Drupal 8 Websites
Tips To Increase The Speed Of Drupal 8 WebsitesTips To Increase The Speed Of Drupal 8 Websites
Tips To Increase The Speed Of Drupal 8 Websites
 
Using memcache to improve php performance
Using memcache to improve php performanceUsing memcache to improve php performance
Using memcache to improve php performance
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcache
 
Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 

Semelhante a How to reduce database load using Memcache

Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
Acquia
 
Memcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainMemcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav Jain
Drupal Camp Delhi
 

Semelhante a How to reduce database load using Memcache (20)

Drupal7 MEMCACHE
Drupal7 MEMCACHE Drupal7 MEMCACHE
Drupal7 MEMCACHE
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
 
Memcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainMemcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav Jain
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
 
Memcache basics on google app engine
Memcache basics on google app engineMemcache basics on google app engine
Memcache basics on google app engine
 
Caching objects-in-memory
Caching objects-in-memoryCaching objects-in-memory
Caching objects-in-memory
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and Scalability
 
Memcache d
Memcache dMemcache d
Memcache d
 
Memcached B box presentation
Memcached B box presentationMemcached B box presentation
Memcached B box presentation
 
Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
 
Session Handling Using Memcache
Session Handling Using MemcacheSession Handling Using Memcache
Session Handling Using Memcache
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimization
 
Give Your Site a Boost with Memcache
Give Your Site a Boost with MemcacheGive Your Site a Boost with Memcache
Give Your Site a Boost with Memcache
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Optimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and TricksOptimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and Tricks
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
 

Mais de valuebound

How to Use DDEV to Streamline Your Drupal Development Process.
How to Use DDEV to Streamline Your Drupal Development Process.How to Use DDEV to Streamline Your Drupal Development Process.
How to Use DDEV to Streamline Your Drupal Development Process.
valuebound
 
How to Use AWS to Automate Your IT Operation| Valuebound
How to Use AWS to Automate Your IT Operation| Valuebound How to Use AWS to Automate Your IT Operation| Valuebound
How to Use AWS to Automate Your IT Operation| Valuebound
valuebound
 
The Benefits of Cloud Engineering
The Benefits of Cloud EngineeringThe Benefits of Cloud Engineering
The Benefits of Cloud Engineering
valuebound
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
valuebound
 
The Future of Cloud Engineering: Emerging Trends and Technologies to Watch in...
The Future of Cloud Engineering: Emerging Trends and Technologies to Watch in...The Future of Cloud Engineering: Emerging Trends and Technologies to Watch in...
The Future of Cloud Engineering: Emerging Trends and Technologies to Watch in...
valuebound
 

Mais de valuebound (20)

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

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

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.