SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Designing Enterprise Drupal
How to scale Drupal server infrastructure
ENVIRONMENTS
INTRODUCTIONS
• Jason Burnett (jason@neospire.net)
NeoSpire Director of Infrastructure
SO…FIRST THING’S FIRST
• Prerequisites that you’ll need (or at least want).
– A good, reliable network with plenty of capacity
– At least one expert Systems Administrator
• You don’t necessarily need this:
OKAY, LET’S TALK STACKS
Apache
PHP
Drupal
MySQL
Varnish
Apache
APC
PHP
Pressflow
Memcached
Solr
MySQL
Default Stack Performance Stack
FIRST, DON’T USE DRUPAL
(WELL, SORTA)
Pressflow
Apache
PHP
Drupal
MySQL
• Drop-in replacement for Drupal 6.x
• Support for database replication
• Support for reverse proxy caching
• Optimization for MySQL
• Optimization for PHP 5
• Available at:
http://fourkitchens.com/pressflow-
makes-drupal-scale
AFTER PRESSFLOW, IT’S ALL ABOUT
CACHE
Varnish
Varnish
Apache
PHP
Pressflow
MySQL
• Varnish is a reverse proxy cache
• Caches content based on HTTP
headers
• Uses kernel-based virtual memory
• Watch out for cookies,
authenticated users
• Great Config http://lb.cm/ZyR
• Thanks quicksketch!
• Available at
http://varnish-cache.org/
HTTP PIPELINE
Apache Configuration Varnish Configuration
NameVirtualHost *:8080
Listen 8080
<VirtualHost *:8080>
[…]
</VirtualHost>
backend default {
.host = "127.0.0.1";
.port = "8080";
}
HTTP LOGGING
• VarnishNCSA daemon handles logging
• Default Apache logs will always show 127.0.0.1
• Define a new log format to use X-Forwarded-For
LogFormat "%{X-Forwarded-For}i %l %u %t "%r" %>s
%b "%{Referer}i" "%{User-Agent}i""
combined_proxy
CustomLog /var/log/apache2/access.log
combined_proxy
CACHING WITH COOKIES
sub vcl_recv {
// Remove has_js and Google Analytics __* cookies.
set req.http.Cookie = regsuball(req.http.Cookie, "(^|;s*)(__[a-
z]+|has_js)=[^;]*", "");
// Remove a ";" prefix, if present.
set req.http.Cookie = regsub(req.http.Cookie, "^;s*", "");
// Remove empty cookies.
if (req.http.Cookie ~ "^s*$") {
unset req.http.Cookie;
}
}
sub vcl_hash {
// Include cookie in cache hash
if (req.http.Cookie) {
set req.hash += req.http.Cookie;
}
}
BASIC SECURITY
// Define the internal network subnets
acl internal {
"127.0.0.0"/8;
"10.0.0.0"/8;
}
sub vcl_recv {
[…]
// Do not allow outside access to cron.php
if (req.url ~ "^/cron.php(?.*)?$" && !client.ip ~ internal) {
set req.url = "/404-cron.php";
}
}
VARNISH IS SUPER-FAST
/etc/security/limits.conf
• Able to handle many more connections than
Apache
• Needs a large number of file handles
* soft nofile 131072
* hard nofile 131072
APACHE OPTIMIZATIONS
Apache
Varnish
Apache
PHP
Pressflow
MySQL
• Tune apache to match your
hardware
• Setting MaxClients too high is
asking for trouble
• Every application is different
• A good starting point is total
amount of memory allocated
to Apache divided by 40MB
• One of the areas that will
need to be monitored and
updated on an ongoing basis
STILL ALL ABOUT CACHE
• APC Opcode Cache APC
Varnish
Apache
APC
PHP
Pressflow
MySQL
• APC is an Opcode cache
• Officially supported by PHP
• Prevents unnecessary PHP
parsing and compiling
• Reduces load on Memory
and CPU
ALLOCATE ENOUGH MEMORY FOR APC
extension=apc.so
apc.shm_size=120
apc.ttl=300
kernel.shmmax=13421
7728
Php.ini Sysctl.conf
EVEN MORE CACHE
• Memcached Memcached
Varnish
Apache
APC
PHP
Pressflow
Memcached
MySQL
• Memcached is a
distributed memory object
caching system
• Reduces load on database
• Simple key/value datastore
MEMCACHED BINS
/usr/bin/memcached -d -p 11211 -u nobody -m 64
/usr/bin/memcached -d -p 11212 -u nobody -m 16
/usr/bin/memcached -d -p 11213 -u nobody -m 128
/usr/bin/memcached -d -p 11214 -u nobody -m 128
/usr/bin/memcached -d -p 11215 -u nobody -m 16
/usr/bin/memcached -d -p 11216 -u nobody -m 8
/usr/bin/memcached -d -p 11217 -u nobody -m 8
/usr/bin/memcached -d -p 11218 -u nobody -m 8
/usr/bin/memcached -d -p 11219 -u nobody -m 8
/usr/bin/memcached -d -p 11220 -u nobody -m 8
/usr/bin/memcached -d -p 11221 -u nobody -m 8
/usr/bin/memcached -d -p 11222 -u nobody -m 8
/usr/bin/memcached -d -p 11223 -u nobody -m 8
DRUPAL MEMCACHED MODULE
$conf['cache_inc'] =
'sites/all/modules/memcache/memcache.db.inc';
$memcache_servers = array(
'127.0.0.1',
);
foreach ($memcache_servers as $ip) {
$conf['memcache_servers'][$ip . ':11211'] = 'default';
$conf['memcache_servers'][$ip . ':11212'] = 'block';
$conf['memcache_servers'][$ip . ':11213'] = 'content';
$conf['memcache_servers'][$ip . ':11214'] = 'filter';
$conf['memcache_servers'][$ip . ':11215'] = 'menu';
$conf['memcache_servers'][$ip . ':11216'] = 'mollom';
$conf['memcache_servers'][$ip . ':11217'] = 'page';
$conf['memcache_servers'][$ip . ':11218'] = 'views';
$conf['memcache_servers'][$ip . ':11219'] = 'views_data';
$conf['memcache_servers'][$ip . ':11220'] = 'sessions';
$conf['memcache_servers'][$ip . ':11221'] = 'users';
$conf['memcache_servers'][$ip . ':11222'] = 'path_source';
$conf['memcache_servers'][$ip . ':11223'] = 'path_dest';
}
$conf['memcache_bins'] = array(
'sessions' => 'sessions',
'cache' => 'default',
'cache_block' => 'block',
'cache_content' => 'content',
'cache_filter' => 'filter',
'cache_menu' => 'menu',
'cache_mollom' => 'mollom',
'cache_page' => 'page',
'cache_views' => 'views',
'cache_views_data' => 'views_data',
'cache_users' => 'users',
'cache_pathsrc' => 'path_source',
'cache_pathdst' => 'path_dest',
);
BUT WHAT ABOUT SEARCH?
Solr
Varnish
Apache
APC
PHP
Pressflow
Memcached
Solr
MySQL
• Better than native Drupal
search
• Built on standard application
server
• You can decide what J2EE
server to use
• Flexibility allows fault tolerance
• Configurable through the
Drupal Solr module
CAN OTHER STACKS WORK TOO?
• Yes, there are some different technologies and
strategies that do the same thing (nginx, Cassandra,
eAccelerator, etc.).
• Arguments can be made both for/against
• This stack is what we have used in production and feel
is the most stable and enterprise-ready
• We’re always refining our stack too. So far, this is what
we like best. (Currently testing the Comanche web server)
• Project Mercury uses the same stack
BACK TO STACKS
• The beauty of this performance stack…
Varnish
Apache
APC
PHP
Pressflow
Memcached
Solr
MySQL
…is that it can be installed
entirely on a single
server, and that server
will perform well.
But what if one server
isn’t good enough?
SCALE APART
• Because these services are modular, we can separate
server roles
Varnish
Apache
APC
PHP
Pressflow
Memcached
Solr
MySQL
Varnish Server
Web/App Server
Database Server
YOU CAN DO THIS A COUPLE WAYS
• Another example:
Varnish
Apache
APC
PHP
Pressflow
Memcache
Solr
MySQL
Web/App Server
Memcached/Solr
Server
Database Server
HOW WE LIKE TO DO IT
• This is our standard separation
Varnish
Apache
APC
PHP
Pressflow
Memcached
Solr
MySQL
Web/App
Server
Database
Server
SCALE FURTHER: LOAD-BALANCING
• Multiple web servers
can be load-balanced
for greater capacity,
using the same
database
• Single-points of
failure apparent.
• Load balancing
utilizing LVS
Web/App
Server
Web/App
Server
Database
Server
Load Balancer(s)
Load-balanced Architecture
FILE SYNCHRONIZATION
• NFS NFS
Varnish
Apache
APC
PHP
Pressflow
Memcached
Solr
MySQL
NFS
•NFS allows multiple
web/app servers to
seamlessly serve the same
content
•User uploaded content is
instantly available to all web
servers
•Any code changes only need
to be made in one location
LOGS
• Syslog Syslog
Varnish
Apache
APC
PHP
Pressflow
Memcached
Solr
MySQL
NFS
Syslog
•Drupal can log to syslog,
reducing load on the
database
•Sending logs to a central
location allows for easy
review
FAULT TOLERANCE IS IMPORTANT NOW
High Availability Architecture
• Now that we’re
scaling out with more
capacity, we’re
probably really scared
of the DB failing
• MySQL circular
replication
• NFS-HA
• Solr fault tolerance
• All managed by
Heartbeat
Web/App
Server
Web/App
Server
MySQL / NFS
Server
Load Balancer(s)
MySQL / NFS
Server
MYSQL CIRCULAR REPLICATION
• Circular replication is the method by which we
synchronize data
• There are 2 IP addresses (master and slave)
• Heartbeat is used to automatically failover the
addresses when necessary
MySQL Server 1 MySQL Server 2
NFS HA USING DRBD
• Data synchronization handled with DRBD
• Distributed Replicated Block Device (DRBD)
– Essentially RAID1 over the network
– Only one NFS server is able to access the data at a time, which is
why we have the IP management
• IP management is handled by Heartbeat automatically
NFS Server 1 NFS Server 2
SOLR
• Data synchronization handled with DRBD
• Distributed Replicated Block Device (DRBD)
– Essentially RAID1 over the network
– Only one Solr server is able to access the data at a time, which is
why we have the IP management
• IP management is handled by Heartbeat automatically
Solr Server 1 Solr Server 2
SKY’S THE LIMIT
Web
Server
Web
Server
Web
Server
Web
Server
Web
Server
Web
Server
Web
Server
Web
Server
Load Balancer(s)
MySQL
Server
MySQL
Server
NFS
Server
NFS
Server
Solr
Server
Solr
Server
OTHER THINGS TO CONSIDER
• Drush
• Monitoring
– Availability
– Core updates
– Module updates
– Munin
• CDN
LESSONS WE’VE LEARNED
…things we’ve picked up from experience
• Conntrack tables
– Disable all the IPTables
connection tracking modules
unless you need them
• NTP
– Time synchronization is
extremely important on any
system that utilizes Heartbeat
• Load Testing
– Load test your solutions and
make sure you can achieve
your goal
Thanks a bunch!
QUESTIONS?

Weitere ähnliche Inhalte

Was ist angesagt?

ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLRené Cannaò
 
High performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLHigh performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLMydbops
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLSeveralnines
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 
MySQL Performance Tuning Variables
MySQL Performance Tuning VariablesMySQL Performance Tuning Variables
MySQL Performance Tuning VariablesFromDual GmbH
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017Severalnines
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMorgan Tocker
 
Mysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql FabricMysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql FabricMysql User Camp
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityOSSCube
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedGear6
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...Severalnines
 
Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMariaDB plc
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Mydbops
 
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise ClusterWebseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise ClusterMariaDB Corporation
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Severalnines
 
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)Aurimas Mikalauskas
 
MySQL Shell for Database Engineers
MySQL Shell for Database EngineersMySQL Shell for Database Engineers
MySQL Shell for Database EngineersMydbops
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyContinuent
 

Was ist angesagt? (20)

ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
High performance and high availability proxies for MySQL
High performance and high availability proxies for MySQLHigh performance and high availability proxies for MySQL
High performance and high availability proxies for MySQL
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
MySQL Performance Tuning Variables
MySQL Performance Tuning VariablesMySQL Performance Tuning Variables
MySQL Performance Tuning Variables
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Mysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql FabricMysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql Fabric
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with Memcached
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
 
Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at Facebook
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
 
Perf Tuning Short
Perf Tuning ShortPerf Tuning Short
Perf Tuning Short
 
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise ClusterWebseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
 
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
 
MySQL Shell for Database Engineers
MySQL Shell for Database EngineersMySQL Shell for Database Engineers
MySQL Shell for Database Engineers
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
 

Andere mochten auch

Drupal for Higher Education and Virtual Learning
Drupal for Higher Education and Virtual LearningDrupal for Higher Education and Virtual Learning
Drupal for Higher Education and Virtual LearningGabriel Dragomir
 
Large Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesLarge Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesBoyan Borisov
 
Improving Drupal Performances
Improving Drupal PerformancesImproving Drupal Performances
Improving Drupal PerformancesVladimir Ilic
 
Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Boyan Borisov
 
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)Cogapp
 
Scaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloudScaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloudVladimir Ilic
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Amazee Labs
 
Drupal 8 Development at the Speed of Lightning (& BLT)
Drupal 8 Development at the Speed of Lightning (& BLT)Drupal 8 Development at the Speed of Lightning (& BLT)
Drupal 8 Development at the Speed of Lightning (& BLT)Acquia
 
Open Y: One Digital Platform for all YMCAs
Open Y: One Digital Platform for all YMCAsOpen Y: One Digital Platform for all YMCAs
Open Y: One Digital Platform for all YMCAsAcquia
 
A Future-Focused Digital Platform with Drupal 8
A Future-Focused Digital Platform with Drupal 8A Future-Focused Digital Platform with Drupal 8
A Future-Focused Digital Platform with Drupal 8Acquia
 
How to Optimize Your Drupal Site with Structured Content
How to Optimize Your Drupal Site with Structured ContentHow to Optimize Your Drupal Site with Structured Content
How to Optimize Your Drupal Site with Structured ContentAcquia
 
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)nyccamp
 

Andere mochten auch (12)

Drupal for Higher Education and Virtual Learning
Drupal for Higher Education and Virtual LearningDrupal for Higher Education and Virtual Learning
Drupal for Higher Education and Virtual Learning
 
Large Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesLarge Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the Scenes
 
Improving Drupal Performances
Improving Drupal PerformancesImproving Drupal Performances
Improving Drupal Performances
 
Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Better editorial experience in Drupal 7
Better editorial experience in Drupal 7
 
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)
 
Scaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloudScaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloud
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012
 
Drupal 8 Development at the Speed of Lightning (& BLT)
Drupal 8 Development at the Speed of Lightning (& BLT)Drupal 8 Development at the Speed of Lightning (& BLT)
Drupal 8 Development at the Speed of Lightning (& BLT)
 
Open Y: One Digital Platform for all YMCAs
Open Y: One Digital Platform for all YMCAsOpen Y: One Digital Platform for all YMCAs
Open Y: One Digital Platform for all YMCAs
 
A Future-Focused Digital Platform with Drupal 8
A Future-Focused Digital Platform with Drupal 8A Future-Focused Digital Platform with Drupal 8
A Future-Focused Digital Platform with Drupal 8
 
How to Optimize Your Drupal Site with Structured Content
How to Optimize Your Drupal Site with Structured ContentHow to Optimize Your Drupal Site with Structured Content
How to Optimize Your Drupal Site with Structured Content
 
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
Hack Into Drupal Sites (or, How to Secure Your Drupal Site)
 

Ähnlich wie Designing enterprise drupal

Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!WordCamp Cape Town
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The SnailMarcus Deglos
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APCBen Ramsey
 
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...Nexcess.net LLC
 
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…Atwix
 
Bottom to Top Stack Optimization with LAMP
Bottom to Top Stack Optimization with LAMPBottom to Top Stack Optimization with LAMP
Bottom to Top Stack Optimization with LAMPkatzgrau
 
Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011CodeIgniter Conference
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutSander Temme
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkBryan Ollendyke
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
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 InternetAchieve 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 InternetAchieve Internet
 
OSDC 2016 - Tuning Linux for your Database by Colin Charles
OSDC 2016 - Tuning Linux for your Database by Colin CharlesOSDC 2016 - Tuning Linux for your Database by Colin Charles
OSDC 2016 - Tuning Linux for your Database by Colin CharlesNETWAYS
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017Ivan Zoratti
 
Cache all the things - A guide to caching Drupal
Cache all the things - A guide to caching DrupalCache all the things - A guide to caching Drupal
Cache all the things - A guide to caching Drupaldigital006
 
High Performance Drupal Sites
High Performance Drupal SitesHigh Performance Drupal Sites
High Performance Drupal SitesAbayomi Ayoola
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storageMarian Marinov
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephRongze Zhu
 

Ähnlich wie Designing enterprise drupal (20)

Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
 
Top ten-list
Top ten-listTop ten-list
Top ten-list
 
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
 
Bottom to Top Stack Optimization with LAMP
Bottom to Top Stack Optimization with LAMPBottom to Top Stack Optimization with LAMP
Bottom to Top Stack Optimization with LAMP
 
Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
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
 
OSDC 2016 - Tuning Linux for your Database by Colin Charles
OSDC 2016 - Tuning Linux for your Database by Colin CharlesOSDC 2016 - Tuning Linux for your Database by Colin Charles
OSDC 2016 - Tuning Linux for your Database by Colin Charles
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017
 
Cache all the things - A guide to caching Drupal
Cache all the things - A guide to caching DrupalCache all the things - A guide to caching Drupal
Cache all the things - A guide to caching Drupal
 
High Performance Drupal Sites
High Performance Drupal SitesHigh Performance Drupal Sites
High Performance Drupal Sites
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
 

Kürzlich hochgeladen

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Kürzlich hochgeladen (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Designing enterprise drupal

  • 1. Designing Enterprise Drupal How to scale Drupal server infrastructure ENVIRONMENTS
  • 2. INTRODUCTIONS • Jason Burnett (jason@neospire.net) NeoSpire Director of Infrastructure
  • 3. SO…FIRST THING’S FIRST • Prerequisites that you’ll need (or at least want). – A good, reliable network with plenty of capacity – At least one expert Systems Administrator • You don’t necessarily need this:
  • 4. OKAY, LET’S TALK STACKS Apache PHP Drupal MySQL Varnish Apache APC PHP Pressflow Memcached Solr MySQL Default Stack Performance Stack
  • 5. FIRST, DON’T USE DRUPAL (WELL, SORTA) Pressflow Apache PHP Drupal MySQL • Drop-in replacement for Drupal 6.x • Support for database replication • Support for reverse proxy caching • Optimization for MySQL • Optimization for PHP 5 • Available at: http://fourkitchens.com/pressflow- makes-drupal-scale
  • 6. AFTER PRESSFLOW, IT’S ALL ABOUT CACHE Varnish Varnish Apache PHP Pressflow MySQL • Varnish is a reverse proxy cache • Caches content based on HTTP headers • Uses kernel-based virtual memory • Watch out for cookies, authenticated users • Great Config http://lb.cm/ZyR • Thanks quicksketch! • Available at http://varnish-cache.org/
  • 7. HTTP PIPELINE Apache Configuration Varnish Configuration NameVirtualHost *:8080 Listen 8080 <VirtualHost *:8080> […] </VirtualHost> backend default { .host = "127.0.0.1"; .port = "8080"; }
  • 8. HTTP LOGGING • VarnishNCSA daemon handles logging • Default Apache logs will always show 127.0.0.1 • Define a new log format to use X-Forwarded-For LogFormat "%{X-Forwarded-For}i %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined_proxy CustomLog /var/log/apache2/access.log combined_proxy
  • 9. CACHING WITH COOKIES sub vcl_recv { // Remove has_js and Google Analytics __* cookies. set req.http.Cookie = regsuball(req.http.Cookie, "(^|;s*)(__[a- z]+|has_js)=[^;]*", ""); // Remove a ";" prefix, if present. set req.http.Cookie = regsub(req.http.Cookie, "^;s*", ""); // Remove empty cookies. if (req.http.Cookie ~ "^s*$") { unset req.http.Cookie; } } sub vcl_hash { // Include cookie in cache hash if (req.http.Cookie) { set req.hash += req.http.Cookie; } }
  • 10. BASIC SECURITY // Define the internal network subnets acl internal { "127.0.0.0"/8; "10.0.0.0"/8; } sub vcl_recv { […] // Do not allow outside access to cron.php if (req.url ~ "^/cron.php(?.*)?$" && !client.ip ~ internal) { set req.url = "/404-cron.php"; } }
  • 11. VARNISH IS SUPER-FAST /etc/security/limits.conf • Able to handle many more connections than Apache • Needs a large number of file handles * soft nofile 131072 * hard nofile 131072
  • 12. APACHE OPTIMIZATIONS Apache Varnish Apache PHP Pressflow MySQL • Tune apache to match your hardware • Setting MaxClients too high is asking for trouble • Every application is different • A good starting point is total amount of memory allocated to Apache divided by 40MB • One of the areas that will need to be monitored and updated on an ongoing basis
  • 13. STILL ALL ABOUT CACHE • APC Opcode Cache APC Varnish Apache APC PHP Pressflow MySQL • APC is an Opcode cache • Officially supported by PHP • Prevents unnecessary PHP parsing and compiling • Reduces load on Memory and CPU
  • 14. ALLOCATE ENOUGH MEMORY FOR APC extension=apc.so apc.shm_size=120 apc.ttl=300 kernel.shmmax=13421 7728 Php.ini Sysctl.conf
  • 15. EVEN MORE CACHE • Memcached Memcached Varnish Apache APC PHP Pressflow Memcached MySQL • Memcached is a distributed memory object caching system • Reduces load on database • Simple key/value datastore
  • 16. MEMCACHED BINS /usr/bin/memcached -d -p 11211 -u nobody -m 64 /usr/bin/memcached -d -p 11212 -u nobody -m 16 /usr/bin/memcached -d -p 11213 -u nobody -m 128 /usr/bin/memcached -d -p 11214 -u nobody -m 128 /usr/bin/memcached -d -p 11215 -u nobody -m 16 /usr/bin/memcached -d -p 11216 -u nobody -m 8 /usr/bin/memcached -d -p 11217 -u nobody -m 8 /usr/bin/memcached -d -p 11218 -u nobody -m 8 /usr/bin/memcached -d -p 11219 -u nobody -m 8 /usr/bin/memcached -d -p 11220 -u nobody -m 8 /usr/bin/memcached -d -p 11221 -u nobody -m 8 /usr/bin/memcached -d -p 11222 -u nobody -m 8 /usr/bin/memcached -d -p 11223 -u nobody -m 8
  • 17. DRUPAL MEMCACHED MODULE $conf['cache_inc'] = 'sites/all/modules/memcache/memcache.db.inc'; $memcache_servers = array( '127.0.0.1', ); foreach ($memcache_servers as $ip) { $conf['memcache_servers'][$ip . ':11211'] = 'default'; $conf['memcache_servers'][$ip . ':11212'] = 'block'; $conf['memcache_servers'][$ip . ':11213'] = 'content'; $conf['memcache_servers'][$ip . ':11214'] = 'filter'; $conf['memcache_servers'][$ip . ':11215'] = 'menu'; $conf['memcache_servers'][$ip . ':11216'] = 'mollom'; $conf['memcache_servers'][$ip . ':11217'] = 'page'; $conf['memcache_servers'][$ip . ':11218'] = 'views'; $conf['memcache_servers'][$ip . ':11219'] = 'views_data'; $conf['memcache_servers'][$ip . ':11220'] = 'sessions'; $conf['memcache_servers'][$ip . ':11221'] = 'users'; $conf['memcache_servers'][$ip . ':11222'] = 'path_source'; $conf['memcache_servers'][$ip . ':11223'] = 'path_dest'; } $conf['memcache_bins'] = array( 'sessions' => 'sessions', 'cache' => 'default', 'cache_block' => 'block', 'cache_content' => 'content', 'cache_filter' => 'filter', 'cache_menu' => 'menu', 'cache_mollom' => 'mollom', 'cache_page' => 'page', 'cache_views' => 'views', 'cache_views_data' => 'views_data', 'cache_users' => 'users', 'cache_pathsrc' => 'path_source', 'cache_pathdst' => 'path_dest', );
  • 18. BUT WHAT ABOUT SEARCH? Solr Varnish Apache APC PHP Pressflow Memcached Solr MySQL • Better than native Drupal search • Built on standard application server • You can decide what J2EE server to use • Flexibility allows fault tolerance • Configurable through the Drupal Solr module
  • 19. CAN OTHER STACKS WORK TOO? • Yes, there are some different technologies and strategies that do the same thing (nginx, Cassandra, eAccelerator, etc.). • Arguments can be made both for/against • This stack is what we have used in production and feel is the most stable and enterprise-ready • We’re always refining our stack too. So far, this is what we like best. (Currently testing the Comanche web server) • Project Mercury uses the same stack
  • 20. BACK TO STACKS • The beauty of this performance stack… Varnish Apache APC PHP Pressflow Memcached Solr MySQL …is that it can be installed entirely on a single server, and that server will perform well. But what if one server isn’t good enough?
  • 21. SCALE APART • Because these services are modular, we can separate server roles Varnish Apache APC PHP Pressflow Memcached Solr MySQL Varnish Server Web/App Server Database Server
  • 22. YOU CAN DO THIS A COUPLE WAYS • Another example: Varnish Apache APC PHP Pressflow Memcache Solr MySQL Web/App Server Memcached/Solr Server Database Server
  • 23. HOW WE LIKE TO DO IT • This is our standard separation Varnish Apache APC PHP Pressflow Memcached Solr MySQL Web/App Server Database Server
  • 24. SCALE FURTHER: LOAD-BALANCING • Multiple web servers can be load-balanced for greater capacity, using the same database • Single-points of failure apparent. • Load balancing utilizing LVS Web/App Server Web/App Server Database Server Load Balancer(s) Load-balanced Architecture
  • 25. FILE SYNCHRONIZATION • NFS NFS Varnish Apache APC PHP Pressflow Memcached Solr MySQL NFS •NFS allows multiple web/app servers to seamlessly serve the same content •User uploaded content is instantly available to all web servers •Any code changes only need to be made in one location
  • 26. LOGS • Syslog Syslog Varnish Apache APC PHP Pressflow Memcached Solr MySQL NFS Syslog •Drupal can log to syslog, reducing load on the database •Sending logs to a central location allows for easy review
  • 27. FAULT TOLERANCE IS IMPORTANT NOW High Availability Architecture • Now that we’re scaling out with more capacity, we’re probably really scared of the DB failing • MySQL circular replication • NFS-HA • Solr fault tolerance • All managed by Heartbeat Web/App Server Web/App Server MySQL / NFS Server Load Balancer(s) MySQL / NFS Server
  • 28. MYSQL CIRCULAR REPLICATION • Circular replication is the method by which we synchronize data • There are 2 IP addresses (master and slave) • Heartbeat is used to automatically failover the addresses when necessary MySQL Server 1 MySQL Server 2
  • 29. NFS HA USING DRBD • Data synchronization handled with DRBD • Distributed Replicated Block Device (DRBD) – Essentially RAID1 over the network – Only one NFS server is able to access the data at a time, which is why we have the IP management • IP management is handled by Heartbeat automatically NFS Server 1 NFS Server 2
  • 30. SOLR • Data synchronization handled with DRBD • Distributed Replicated Block Device (DRBD) – Essentially RAID1 over the network – Only one Solr server is able to access the data at a time, which is why we have the IP management • IP management is handled by Heartbeat automatically Solr Server 1 Solr Server 2
  • 31. SKY’S THE LIMIT Web Server Web Server Web Server Web Server Web Server Web Server Web Server Web Server Load Balancer(s) MySQL Server MySQL Server NFS Server NFS Server Solr Server Solr Server
  • 32. OTHER THINGS TO CONSIDER • Drush • Monitoring – Availability – Core updates – Module updates – Munin • CDN
  • 33. LESSONS WE’VE LEARNED …things we’ve picked up from experience • Conntrack tables – Disable all the IPTables connection tracking modules unless you need them • NTP – Time synchronization is extremely important on any system that utilizes Heartbeat • Load Testing – Load test your solutions and make sure you can achieve your goal

Hinweis der Redaktion

  1. Welcome to our presentation over designing ent drupal environments. This presentation is being given from an infrastructure viewpoint, there are many different aspects to take into consideration from a development perspective and there a lot more qualified folks here that can talk about that aspect. Today we are going to walk you through the software that we have found has the best balance of stability and speed for applications that have to be up all the time and are high traffic sites. All slides will be available online once the presentation is complete and we will be here and available for questions.
  2. A good network is an absolute requirement in order to run a big Drupal environment, if you plan on getting any press or decent traffic at all, then making sure that you set requirements for your hosting provider is crucial. The main points to require are 1) You should require a gigabit, dedicated connection to their core network 2) A network that has a guaranteed SLA 3) a guarantee that they have the capacity to support your growth.
  3. This is the semi-unofficial standard Drupal stack. There are a lot of packages here that can be replaced by other packages, some better, some worse. Through our experience we have found that this is currently the most scalable and reliable stack we have deployed. That does not mean we have a problem with Cassandra or nginx, just that we have not gone through enough deployments with those packages to call them “standard” yet. That could change very soon. Quick descriptions: Varnish is the outward most facing cache APC is our opcode cache Apache/PHP is our webserver and interpreter Pressflow is the port of Drupal that we currently use Memcache is our backend caching mechanism MySQL is our database system
  4. (Directly from fourkitchens.com) Support for database replication Replication in MySQL takes the data from a designated master server and copies it out to any number of other MySQL servers. Pressflow can then use these replicated MySQL servers for time-consuming query operations that would otherwise slow down the central database. Pressflow’s replication model (and much of the same software) is currently in use on Drupal.org and numerous large Drupal sites, but similar support for replication won’t be available in standard Drupal releases until version 7, which includes a new database abstraction layer. Support for Squid and Varnish reverse proxy caching A reverse proxy cache takes most of the load of anonymous browsing off of Drupal, PHP, Apache, and MySQL by placing a high-performance cache in front of the rest of the web application stack. This cache accelerates static content, like CSS, Javascript, and image files, as well as full web pages for anonymous users. Squid and Varnish are the most popular free, open-source reverse proxy caches, and are used to deliver sites as high-traffic as Wikipedia. The key to effective reverse proxy cache deployment is having the content management system inform the cache what it can and cannot cache. Currently, only Pressflow supports this capability. Optimization for MySQL Drupal is designed to run on MySQL, PostgreSQL, and (beginning with Drupal 7) SQLite. While this gives Drupal broad storage support, the vast majority of Drupal sites run on MySQL, especially the largest ones. Pressflow only supports MySQL, which allows it to quickly integrate optimizations that, when proposed for Drupal, often face delays resulting from the need to support multiple database engines. Optimization for PHP 5 Drupal includes “wrapper” functions to provide PHP 5-style operations on PHP 4. These wrapper functions increase the size of the code and are often dramatically slower than their native PHP 5 equivalents. Because Pressflow only supports PHP 5, it can replace these wrapper functions with their high-performance PHP 5 equivalents.
  5. Varnish is our reverse proxy cache, this is the biggest win available when trying to scale a site to accommodate mass traffic increases.
  6. Here we are telling Apache to STOP listening on port 80 and instead listen on port 8080, we also inform varnish that it should accept all incoming port 80 requests and utilize apache running on port 8080 to populate it’s cache and serve those requests.
  7. Apache logs are really only helpful if you want to compare how much traffic is getting handled by varnish, vs how much is making it through to apache
  8. Varnish cannot cache as effectively when cookies are present. By default, it does not cache anything if a cookie is present in the request headers. It creates a hash from the HTTP headers to look up cached content, and if anything is different (i.e. cookie content), a different hash is generated and the benefits of caching are negated. Vcl_recv is executed on every incoming request Google analytics continues to function, even without the cookies, so we strip these. Any other cookies that are not actually processed by your application are also safe to strip The rest of this function is just cleanup, so we are creating as many consistent hashes as possible Vcl_hash is called when varnish calculates the hash. This code instructs it to hash the cookie headers instead of just skipping it.
  9. Protect yourself against DOS attacks by only allowing specific network segments to access cron.php. 404-cron.php does not need to exist, drupal will handle it with its own 404 error handling, and this entry will be logged so that you can be aware of any unwanted access attempts to cron.php This same procedure can be used to protect other sensitive URLs, such as update.php or install.php
  10. Because varnish is able to serve pages from cache so quickly, it can handle a much larger number of incoming HTTP connections than a standard apache server. As such, it needs to be able to open and maintain a large number of file handles to manage its HTTP connections and cache content. Here we are just telling to kernel to allow more file handles than is enabled by default.
  11. Again, every application is different, so these values will need to be tuned accordingly, but a good starting point is 120MB In addition to the php.ini configuration, the kernel needs to be configured to provide access to enough shared memory
  12. Every table in Drupal mysql that starts with cache_ can go into memcache and it’s common to setup a separate bucket for each table. A bucket is a term used to identify an allocation of memory that is set aside for a portion of the cache. Each bucket is actually a separate memcache instance.
  13. Multiple bins require separate instances on different ports
  14. Setting up the Drupal memcache module to utilize our newly created bins is pretty straight forward. You provide the memcache server in the memcache_server array, Assign each of the memcache instances to a drupal table in the foreach loop, then assign the tables to buckets in the memcache_bins array.
  15. This is what we will assume for the rest of the presentation
  16. Varnish can use it’s own server depending on your configuration.
  17. This is fairly standard for a starting site.
  18. Phase 1, beta|testing
  19. LVS, F5, Cisco CSS 11501
  20. Failover for redundancy, not load balanced
  21. Multiple servers to one place
  22. Just a few items that we have come across.