SlideShare uma empresa Scribd logo
1 de 33
Drupal performance
Analysis & Optimisations
Piyuesh Kumar
Technical Architect
QED42
Definition
• Performance
• Scalability
• High Availability
• Load Balancing
• Performance Assessment/Analysis
• Performance Optimisation/Tuning
Defining Goals
• Define your objectives and goals first
• Do you want faster response to the end user
per page
• Do you want to handle more page views?
• Do you want to minimise downtime?
• Each is different, but they can be related
Low hanging fruits
• More Infrastructure
• Applying available Drupal patches
• Re-architecting the application(content-types,
Views etc.)
surgery B, as well as procedure C, and see m
Analysis Tools
• Apache Benchmark/Seige/Jmeter
• ab/ab2 (Apache benchmark)
• ab c 50 n10000 http://example.com
• Requests per second
• Average response time per request
• Use C for authenticated sessions
• Apache tweaks
• Choosing alternatives to Apache
• Mysql
• Mysqlreport
• MySQL DB tuning primer
• slow query log - enabled in my.cnf
Xhprof
Call graph
Site Statistics
• Google Analytics
• Awstats
• ….
Drupal Tools
• Devel module
• Total page execution
• Query execution time
• Query log
• Memory utilisation
• Trace module
• More for debugging, but also useful in knowing wh
at goes on under the hood
Possible Enhancements
Apache Tweaks
• MaxClients (prevent swapping/thrashing)
• Too low: you can't serve a traffic spike (Digg, Slashdot)
• Too high: your memory cannot keep up with the load, and you start sw
apping (server dies!)
• MaxRequestsPerChild
• To terminate the process faster, and free up memory
• KeepAlive
• Should be low (~ 3 seconds)
• mod_gzip/deflate
• Compress HTML, CSS, JS, ..
Alternatives to Apache
• Lighttpd
• Nginx
MySQL Optimisations &
Tweaks
• Engines
• MyISAM
• Faster for reads
• Poor concurrency (table level locking)
• Innodb
• Transactional
• Slower in some cases(SELECT count(*)…)
• Better concurrency(good for heavily hit tables, such as sessions, watchdog)
• Mariadb/Falcon/SolidDB
• Master/Slave architecture
• Query cache
• Table cache
PHP
• Install an Opcode cache / Accelerator
• eAccelerator
• APC
• Xcache
• Zend (commerical)
• Advantages
• Dramatic speed up of applications, specially complex
• ones like Drupal
• Significant decrease in CPU utilisation
• Considerable decrease in memory utilisation
Handling Media Files
• Large video and audio ties up resources for a long time
• Specially to slow connections, or unstable ones (users try
to download again and again)
• Serve them from a separate box
• http://example.com for PHP
• http://media.example.com for video/audio
• Video modules already supports this (but you have to man
ually FTP the videos)
• Use a content delivery network (CDN) e.g. Akamai.
Reverse Proxy
• Varnish
• Nginx
• Advantages
• Avoid requests for static files to
be served from the application-
server.
Drupal Caching
• For anonymous visitors only
• Does not affect authenticated users
• Enable page caching
• May expire too often on a busy site,
causing slow downs!
Using Boost
• Drupal module
• Creates HTML for pages and stores it in files
• Requires changes to .htaccess and symlinks
• Usable on shared hosts as well as VPS.
• Vastly enhances the ability to handle traffic spikes
• Make sure you TRUNCATE sessions when installi
ng, otherwise you will see stale pages
Using Memcached
• Distributed object caching in memory
• No disk I/O (database or files)
• Can span multiple servers (over a LAN)
• Give it a lot of RAM
• Uses Drupal pluggable caching
• Seamless integration with Drupal
How much of effect does
memcache has?
Million Pages
Can Drupal do 1,000,000 page views a day?
• Dedicated server (single server in this case)
• Lean site (no views, no CCK, no locale, no
• statistics, but has votingAPI, fivestar,
• subscriptions)
• Memcache is a live saver
• APC
• Fcgid instead of mod_php (saves memory)
Million Pages
Can Drupal do 1,000,000 page views a day?
• Dedicated server (single server in this case)
• Lean site (no views, no CCK, no locale, no
• statistics, but has votingAPI, fivestar,
• subscriptions)
• Memcache is a live saver
• APC
• Fcgid instead of mod_php (saves memory)
10s of seconds while
creating a node
• A site which tools tens of seconds to process th
e submission of a node
• Og was sending emails to 1,000s of users insta
ntly
• Used job_queue module
Page Loading: Hangs
• Page loading “hangs”
• The site used a digg widget that did a fsock_op
en() call, and digg's API host was down!
• Using netstat, we knew the IP address and saw
many connections
Crawler
• Site is very slow
• A crawler was hitting it repeatedly
• Turned out to a worm
• Use apachetop
• Use iptables to block the Ips
• Freed up resources instantly
Performance Metrics
• Memory
• Disk I/O
• Network
• DDOS
Memory
• Swapping means you don't have enough RAM
• Excessive swapping (thrashing) is server hell!
• Reduce the size of Apache processes (no SVN DAV)
• Reduce the number of Apache processes (MaxClients)
• Turn off processes that are not used (e.g. Java, extra co
pies of email servers, other databases)
• Buy more memory! Cost effective and worth it.
Disk I/O
• First eliminate swapping if get hit by it.
• Get the fastest disks you can. 7200 RPM at a mi
nimum.
• Turn off PHP error logging to /var/log/*/error.log
• Consider disabling watchdog module in favour of
syslog
• Optimise MySQL once a week, or once a day.
Network
• Normally not an issue, but make sure you have
enough bandwidth.
• Occasionally you will have stubborn crawlers t
hough Or even a DDoS
DDOS
• “Distributed Denial of Service”
• Aggressive crawlers
• Worms probing for vulnerabilities
• Diagnosis: Look in the web server log or use A
pachetop
• Solution: use iptables to block the addresses
Thank You!

Mais conteúdo relacionado

Mais procurados

Scaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL ServersScaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL Serversheraflux
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL-Consulting
 
CI_CONF 2012: Scaling
CI_CONF 2012: ScalingCI_CONF 2012: Scaling
CI_CONF 2012: ScalingChris Miller
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkBryan Ollendyke
 
Scaling WordPress on DigitalOcean
Scaling WordPress on DigitalOceanScaling WordPress on DigitalOcean
Scaling WordPress on DigitalOceanServerGuy
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"Binary Studio
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data centerHoward Marks
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimizationShafqat Hussain
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sitesdrupalcampest
 
Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Tom Laszewski
 
Software defined storage real or bs-2014
Software defined storage real or bs-2014Software defined storage real or bs-2014
Software defined storage real or bs-2014Howard Marks
 
Building Storage for Clouds (ONUG Spring 2015)
Building Storage for Clouds (ONUG Spring 2015)Building Storage for Clouds (ONUG Spring 2015)
Building Storage for Clouds (ONUG Spring 2015)Howard Marks
 
Varrow datacenter storage today and tomorrow
Varrow   datacenter storage today and tomorrowVarrow   datacenter storage today and tomorrow
Varrow datacenter storage today and tomorrowpittmantony
 
Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)Payal Singh
 
Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparisonRohit Kelapure
 
Vm13 vnx mixed workloads
Vm13 vnx mixed workloadsVm13 vnx mixed workloads
Vm13 vnx mixed workloadspittmantony
 
MongoDB and Amazon Web Services: Storage Options for MongoDB Deployments
MongoDB and Amazon Web Services: Storage Options for MongoDB DeploymentsMongoDB and Amazon Web Services: Storage Options for MongoDB Deployments
MongoDB and Amazon Web Services: Storage Options for MongoDB DeploymentsMongoDB
 
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE PlatformLarge Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE PlatformDataStax Academy
 

Mais procurados (19)

Scaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL ServersScaling Up and Out your Virtualized SQL Servers
Scaling Up and Out your Virtualized SQL Servers
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
 
CI_CONF 2012: Scaling
CI_CONF 2012: ScalingCI_CONF 2012: Scaling
CI_CONF 2012: Scaling
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
 
Scaling WordPress on DigitalOcean
Scaling WordPress on DigitalOceanScaling WordPress on DigitalOcean
Scaling WordPress on DigitalOcean
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data center
 
Drupal 7 performance and optimization
Drupal 7 performance and optimizationDrupal 7 performance and optimization
Drupal 7 performance and optimization
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWS
 
Software defined storage real or bs-2014
Software defined storage real or bs-2014Software defined storage real or bs-2014
Software defined storage real or bs-2014
 
Building Storage for Clouds (ONUG Spring 2015)
Building Storage for Clouds (ONUG Spring 2015)Building Storage for Clouds (ONUG Spring 2015)
Building Storage for Clouds (ONUG Spring 2015)
 
Varrow datacenter storage today and tomorrow
Varrow   datacenter storage today and tomorrowVarrow   datacenter storage today and tomorrow
Varrow datacenter storage today and tomorrow
 
Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)Provisioning and automating high availability postgres on aws ec2 (1)
Provisioning and automating high availability postgres on aws ec2 (1)
 
Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
 
Storage for VDI
Storage for VDIStorage for VDI
Storage for VDI
 
Vm13 vnx mixed workloads
Vm13 vnx mixed workloadsVm13 vnx mixed workloads
Vm13 vnx mixed workloads
 
MongoDB and Amazon Web Services: Storage Options for MongoDB Deployments
MongoDB and Amazon Web Services: Storage Options for MongoDB DeploymentsMongoDB and Amazon Web Services: Storage Options for MongoDB Deployments
MongoDB and Amazon Web Services: Storage Options for MongoDB Deployments
 
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE PlatformLarge Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
 

Destaque

Ch4 densityandbuoyancysection2
Ch4 densityandbuoyancysection2Ch4 densityandbuoyancysection2
Ch4 densityandbuoyancysection2cwyatt01
 
Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...
Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...
Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...Azwaniey Ahmad
 
New microsoft office power point 2007 presentation
New microsoft office power point 2007 presentationNew microsoft office power point 2007 presentation
New microsoft office power point 2007 presentationCarol Green
 
Ch14 forceandmotionsection1
Ch14 forceandmotionsection1Ch14 forceandmotionsection1
Ch14 forceandmotionsection1cwyatt01
 
Ch12 speedsection3
Ch12 speedsection3Ch12 speedsection3
Ch12 speedsection3cwyatt01
 
20110322 oracle
20110322 oracle20110322 oracle
20110322 oracleKwonjs
 
Presentació de Japó
Presentació de JapóPresentació de Japó
Presentació de Japóarnaufranques
 
Future Proofing Your Drupal Skills
Future Proofing Your Drupal SkillsFuture Proofing Your Drupal Skills
Future Proofing Your Drupal SkillsPiyuesh Kumar
 
Pets company
Pets companyPets company
Pets companykysjw24
 
Ch6 atomssection2
Ch6 atomssection2Ch6 atomssection2
Ch6 atomssection2cwyatt01
 
Tugas pokok dan fungsi penyuluh pertanian
Tugas pokok dan fungsi penyuluh pertanianTugas pokok dan fungsi penyuluh pertanian
Tugas pokok dan fungsi penyuluh pertanianAdry Nelson
 
Claims evidence and reasoning presentation
Claims evidence and reasoning presentationClaims evidence and reasoning presentation
Claims evidence and reasoning presentationcwyatt01
 
Marketing opérationnel
Marketing opérationnel Marketing opérationnel
Marketing opérationnel raouia mira
 

Destaque (20)

Ibm
IbmIbm
Ibm
 
Ch4 densityandbuoyancysection2
Ch4 densityandbuoyancysection2Ch4 densityandbuoyancysection2
Ch4 densityandbuoyancysection2
 
Dcp'15
Dcp'15Dcp'15
Dcp'15
 
Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...
Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...
Buah mengkudu atau nama saintifiknya ialah morinda citrifolia telah digunakan...
 
New microsoft office power point 2007 presentation
New microsoft office power point 2007 presentationNew microsoft office power point 2007 presentation
New microsoft office power point 2007 presentation
 
Ch14 forceandmotionsection1
Ch14 forceandmotionsection1Ch14 forceandmotionsection1
Ch14 forceandmotionsection1
 
Ch12 speedsection3
Ch12 speedsection3Ch12 speedsection3
Ch12 speedsection3
 
20110322 oracle
20110322 oracle20110322 oracle
20110322 oracle
 
Presentació de Japó
Presentació de JapóPresentació de Japó
Presentació de Japó
 
Herba
HerbaHerba
Herba
 
Future Proofing Your Drupal Skills
Future Proofing Your Drupal SkillsFuture Proofing Your Drupal Skills
Future Proofing Your Drupal Skills
 
Dcm migration
Dcm migrationDcm migration
Dcm migration
 
Pets company
Pets companyPets company
Pets company
 
Ch6 atomssection2
Ch6 atomssection2Ch6 atomssection2
Ch6 atomssection2
 
Into to drupal8
Into to drupal8Into to drupal8
Into to drupal8
 
Dcp'14 drush
Dcp'14 drushDcp'14 drush
Dcp'14 drush
 
CSPS Test
CSPS TestCSPS Test
CSPS Test
 
Tugas pokok dan fungsi penyuluh pertanian
Tugas pokok dan fungsi penyuluh pertanianTugas pokok dan fungsi penyuluh pertanian
Tugas pokok dan fungsi penyuluh pertanian
 
Claims evidence and reasoning presentation
Claims evidence and reasoning presentationClaims evidence and reasoning presentation
Claims evidence and reasoning presentation
 
Marketing opérationnel
Marketing opérationnel Marketing opérationnel
Marketing opérationnel
 

Semelhante a Drupal performance

DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilitycherryhillco
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance DrupalChapter Three
 
Performance_Out.pptx
Performance_Out.pptxPerformance_Out.pptx
Performance_Out.pptxsanjanabal
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Azug - successfully breeding rabits
Azug - successfully breeding rabitsAzug - successfully breeding rabits
Azug - successfully breeding rabitsYves Goeleven
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtNick Santamaria
 
Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceSpark::red
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in JavaRuben Badaró
 

Semelhante a Drupal performance (20)

DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalability
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
Performance_Out.pptx
Performance_Out.pptxPerformance_Out.pptx
Performance_Out.pptx
 
2 7
2 72 7
2 7
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
title
titletitle
title
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Azug - successfully breeding rabits
Azug - successfully breeding rabitsAzug - successfully breeding rabits
Azug - successfully breeding rabits
 
Performance out
Performance outPerformance out
Performance out
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
 
Configuring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web PerormanceConfiguring Apache Servers for Better Web Perormance
Configuring Apache Servers for Better Web Perormance
 
Performance out
Performance outPerformance out
Performance out
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
 

Drupal performance

  • 1. Drupal performance Analysis & Optimisations Piyuesh Kumar Technical Architect QED42
  • 2. Definition • Performance • Scalability • High Availability • Load Balancing • Performance Assessment/Analysis • Performance Optimisation/Tuning
  • 3. Defining Goals • Define your objectives and goals first • Do you want faster response to the end user per page • Do you want to handle more page views? • Do you want to minimise downtime? • Each is different, but they can be related
  • 4. Low hanging fruits • More Infrastructure • Applying available Drupal patches • Re-architecting the application(content-types, Views etc.)
  • 5. surgery B, as well as procedure C, and see m
  • 6. Analysis Tools • Apache Benchmark/Seige/Jmeter • ab/ab2 (Apache benchmark) • ab c 50 n10000 http://example.com • Requests per second • Average response time per request • Use C for authenticated sessions • Apache tweaks • Choosing alternatives to Apache • Mysql • Mysqlreport • MySQL DB tuning primer • slow query log - enabled in my.cnf
  • 9. Site Statistics • Google Analytics • Awstats • ….
  • 10. Drupal Tools • Devel module • Total page execution • Query execution time • Query log • Memory utilisation • Trace module • More for debugging, but also useful in knowing wh at goes on under the hood
  • 12. Apache Tweaks • MaxClients (prevent swapping/thrashing) • Too low: you can't serve a traffic spike (Digg, Slashdot) • Too high: your memory cannot keep up with the load, and you start sw apping (server dies!) • MaxRequestsPerChild • To terminate the process faster, and free up memory • KeepAlive • Should be low (~ 3 seconds) • mod_gzip/deflate • Compress HTML, CSS, JS, ..
  • 13. Alternatives to Apache • Lighttpd • Nginx
  • 14. MySQL Optimisations & Tweaks • Engines • MyISAM • Faster for reads • Poor concurrency (table level locking) • Innodb • Transactional • Slower in some cases(SELECT count(*)…) • Better concurrency(good for heavily hit tables, such as sessions, watchdog) • Mariadb/Falcon/SolidDB • Master/Slave architecture • Query cache • Table cache
  • 15. PHP • Install an Opcode cache / Accelerator • eAccelerator • APC • Xcache • Zend (commerical) • Advantages • Dramatic speed up of applications, specially complex • ones like Drupal • Significant decrease in CPU utilisation • Considerable decrease in memory utilisation
  • 16.
  • 17. Handling Media Files • Large video and audio ties up resources for a long time • Specially to slow connections, or unstable ones (users try to download again and again) • Serve them from a separate box • http://example.com for PHP • http://media.example.com for video/audio • Video modules already supports this (but you have to man ually FTP the videos) • Use a content delivery network (CDN) e.g. Akamai.
  • 18. Reverse Proxy • Varnish • Nginx • Advantages • Avoid requests for static files to be served from the application- server.
  • 19. Drupal Caching • For anonymous visitors only • Does not affect authenticated users • Enable page caching • May expire too often on a busy site, causing slow downs!
  • 20. Using Boost • Drupal module • Creates HTML for pages and stores it in files • Requires changes to .htaccess and symlinks • Usable on shared hosts as well as VPS. • Vastly enhances the ability to handle traffic spikes • Make sure you TRUNCATE sessions when installi ng, otherwise you will see stale pages
  • 21. Using Memcached • Distributed object caching in memory • No disk I/O (database or files) • Can span multiple servers (over a LAN) • Give it a lot of RAM • Uses Drupal pluggable caching • Seamless integration with Drupal
  • 22. How much of effect does memcache has?
  • 23. Million Pages Can Drupal do 1,000,000 page views a day? • Dedicated server (single server in this case) • Lean site (no views, no CCK, no locale, no • statistics, but has votingAPI, fivestar, • subscriptions) • Memcache is a live saver • APC • Fcgid instead of mod_php (saves memory)
  • 24. Million Pages Can Drupal do 1,000,000 page views a day? • Dedicated server (single server in this case) • Lean site (no views, no CCK, no locale, no • statistics, but has votingAPI, fivestar, • subscriptions) • Memcache is a live saver • APC • Fcgid instead of mod_php (saves memory)
  • 25. 10s of seconds while creating a node • A site which tools tens of seconds to process th e submission of a node • Og was sending emails to 1,000s of users insta ntly • Used job_queue module
  • 26. Page Loading: Hangs • Page loading “hangs” • The site used a digg widget that did a fsock_op en() call, and digg's API host was down! • Using netstat, we knew the IP address and saw many connections
  • 27. Crawler • Site is very slow • A crawler was hitting it repeatedly • Turned out to a worm • Use apachetop • Use iptables to block the Ips • Freed up resources instantly
  • 28. Performance Metrics • Memory • Disk I/O • Network • DDOS
  • 29. Memory • Swapping means you don't have enough RAM • Excessive swapping (thrashing) is server hell! • Reduce the size of Apache processes (no SVN DAV) • Reduce the number of Apache processes (MaxClients) • Turn off processes that are not used (e.g. Java, extra co pies of email servers, other databases) • Buy more memory! Cost effective and worth it.
  • 30. Disk I/O • First eliminate swapping if get hit by it. • Get the fastest disks you can. 7200 RPM at a mi nimum. • Turn off PHP error logging to /var/log/*/error.log • Consider disabling watchdog module in favour of syslog • Optimise MySQL once a week, or once a day.
  • 31. Network • Normally not an issue, but make sure you have enough bandwidth. • Occasionally you will have stubborn crawlers t hough Or even a DDoS
  • 32. DDOS • “Distributed Denial of Service” • Aggressive crawlers • Worms probing for vulnerabilities • Diagnosis: Look in the web server log or use A pachetop • Solution: use iptables to block the addresses