Drupal Memcached Nginx



Similar documents
making drupal run fast

The importance of Drupal Cache. Luis F. Ribeiro Ci&T Inc. 2013

OVERVIEW Methodology Objectives Terminology Recommended Test Protocol... 3 CLOUD SERVICES VS. DEDICATED HOSTING...

How To Use Ngnix (Php) With A Php-Fpm (Php-Fmm) On A Web Server (Php5) On Your Web Browser) On An Ubuntu Web Server On A Raspberry Web 2.5 (Net

Accelerating Wordpress for Pagerank and Profit

(An) Optimal Drupal 7 Module Configuration for Site Performance JOE PRICE

Drupal Performance Tuning

Simple Tips to Improve Drupal Performance: No Coding Required. By Erik Webb, Senior Technical Consultant, Acquia

PHP web serving study Performance report

Running Nginx as Reverse Proxy server

MAGENTO HOSTING Progressive Server Performance Improvements

E-commerce is also about

Installing an open source version of MateCat

5 Mistakes to Avoid on Your Drupal Website

Nginx 1 Web Server Implementation

AUDIT REPORT EXAMPLE

Taking Drupal development to the Cloud. Karel Bemelmans

Magento & Zend Benchmarks Version 1.2, 1.3 (with & without Flat Catalogs)

Cache All The Things

Ensuring scalability and performance with Drupal as your audience grows

Using Redis as a Cache Backend in Magento

Web Load Stress Testing

SharePoint 2010 Performance and Capacity Planning Best Practices

Front-End Performance Testing and Optimization

Wednesday, October 10, 12. Running a High Performance LAMP stack on a $20 Virtual Server

4x High Performance for Drupal. Presented by Fabian Franz. Step by Step

Stress Testing for Performance Tuning. Stress Testing for Performance Tuning

IERG 4080 Building Scalable Internet-based Services

Tobby Hagler, Phase2 Technology

Configuring Nex-Gen Web Load Balancer

Instalar debian 6 atualizado. Executar a sequencia abaixo

Installation, Configuration, and Usage

Embedded Based Web Server for CMS and Automation System

Build it with Drupal 8

Installing Drupal on Your Local Computer

Varnish the Drupal way

Rails Application Deployment. July Philly on Rails

Performance Tuning and Optimization for high traffic Drupal sites. Khalid Baheyeldin Drupal Camp, Toronto May 11 12, 2007

Auditing Drupal sites for performance, content and optimal configuration

Installing Apache, MySQL, PHP, and PECL on Windows

BASICS OF SCALING: LOAD BALANCERS

Learning To Fly: How Angry Birds Reached the Heights of Store Performance

Linux Tools for Monitoring and Performance. Khalid Baheyeldin November 2009 KWLUG

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

CS312 Solutions #6. March 13, 2015

Security Workshop. Apache + SSL exercises in Ubuntu. 1 Install apache2 and enable SSL 2. 2 Generate a Local Certificate 2

Bring your intranet to the IBM i With Drupal and Zend Server

Zend Server Cluster Manager 5.1. Reference Manual. By Zend Technologies.

SiteCelerate white paper

Distributed Systems 19. Content Delivery Networks (CDN) Paul Krzyzanowski

WompMobile Technical FAQ

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

An Introduction to Drupal Architecture. John VanDyk DrupalCamp Des Moines, Iowa September 17, 2011

Content Management Software Drupal : Open Source Software to create library website

CloudLinux is a proven solution for shared hosting providers that:

A Comparative Study on Vega-HTTP & Popular Open-source Web-servers

Distributed Systems. 23. Content Delivery Networks (CDN) Paul Krzyzanowski. Rutgers University. Fall 2015

Automating Testing and Configuration Data Migration in OTM/GTM Projects using Open Source Tools By Rakesh Raveendran Oracle Consulting

Getting FileMaker Server 11 and IIS 7.x to Work with SSL. By Todd Duell

Are You Ready for the Holiday Rush?

Monitoring Nginx Server

EXECUTIVE SUMMARY CONTENTS. 1. Summary 2. Objectives 3. Methodology and Approach 4. Results 5. Next Steps 6. Glossary 7. Appendix. 1.

Big Data with Component Based Software

CloudOYE CDN USER MANUAL

1 Recommended Readings. 2 Resources Required. 3 Compiling and Running on Linux

Optimizing TYPO3 performance

Two Novel Server-Side Attacks against Log File in Shared Web Hosting Servers

Bubble Code Review for Magento

Sitecore Health. Christopher Wojciech. netzkern AG. Sitecore User Group Conference 2015

CMS Diagnostics Guide

Magento Optimised Template CentOS 6 with cpanel/whm V1.0

MassTransit 6.0 Enterprise Web Configuration for Macintosh OS 10.5 Server

Apache Thrift and Ruby

PeopleSoft Online Performance Guidelines

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

PHP Debugging. Draft: March 19, Christopher Vickery

Website Optimization Tips for Speed

Serving 4 million page requests an hour with Magento Enterprise

User Guide Zend Server Community 4.0.3

BOA BARRACUDA ON ÆGIR ~ MY FIRST YEAR ~ Mladen

Load Balancing MODX. Garry Nutting, Senior Developer at MODX, LLC

Remote Desktop With P2P VNC

SI455 Advanced Computer Networking. Lab2: Adding DNS and Servers (v1.0) Due 6 Feb by start of class

Web Performance. Sergey Chernyshev. March '09 New York Web Standards Meetup. New York, NY. March 19 th, 2009

Kollaborate Server Installation Guide!! 1. Kollaborate Server! Installation Guide!

Understanding Slow Start

How to create a load testing environment for your web apps using open source tools by Sukrit Dhandhania

MLADEN

WordPress Optimization

Distributed Systems. 25. Content Delivery Networks (CDN) 2014 Paul Krzyzanowski. Rutgers University. Fall 2014

Transcription:

Drupal Memcached Nginx

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do)

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do)

Technology overview Nginx PHP-FPM Memcached Xhprof Scrapy Siege

Nginx 1000 concurrent connection == normal Serves as a connection 'router' Advanced configuration (variables, control structures,...) Extend with modules http://nginx.org/

PHP-FPM FastCGI Process Manager for PHP Werkt adhv configuratie 'pool' Elk item heeft eigen configuratie Unix socket of TCP poort per entry in pool Chroot http://php-fpm.org/

Memcached Key value store Distributed Key max. 255 chars http://memcached.org/

XHProf Profiler Time spend in each function (inclusive/exclusive wall time) Drill down in functions to pinpoint problems

Scrapy Webscraper (Spider) Sites indexeren Spamlijsten aanleggen Xpath http://scrapy.org/

Siege Advanced 'Apache Benchmark' Crawl list of URL's Output: URL Responscode Time siege -c 100 -t 5m -b -i -f url-list.txt http://joedog.org/siege-home/

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do)

Drupal optimization Optimize application Reduce server load Tune your stack

Drupal optimization Optimize application Reduce server load Tune your stack

Optimize application (1) First Turn pagecaching OFF Turn poormanscron OFF (bad UX) Turn on slow query log (Devel) while developing

Optimize application (2) Crawl site with Speedy Visit all URL's once with Siege Pipe output to file convert to CSV Response code 404's? Internal broken links 302? Extra hit on server! 500? Upstream server is down Tip: tail -f on errorlogs

Optimize application (3) Analyze slow pages XHProf Add caching where applicable (Block, Entity, Views, Webservice calls, ) Turn on php-fpm slowlog on test/production

Drupal optimization Optimize application Reduce server load Tune your stack

Reduce server load Minify Js Aggregate JS & CSS Turn ON pagecaching Correct cache headers CSS Sprites, use repeat-x/y (reduce size) Consider using CDN (CloudFront 0.12$/Gb)

Drupal optimization Optimize application Reduce server load Tune your stack

Tune your stack - Memcached Download & compile Memcached (daemon) Configure, make, make install Start: :~# memcached -u www-data -s /var/run/memcached.sock Use Unix socket if possible (local)

Tune your stack Memcached (2) Install php bindings Apt-get install php5-memcached Enable in php.ini Alter settings.php $conf['cache_backends'][] = './sites/all/modules/contrib/memcache/memcache.inc'; $conf['cache_default_class'] = 'MemCacheDrupal'; $conf['memcache_servers'] = array( ); 'unix:///var/run/memcached.sock' => 'default',

Tune your stack Nginx Compile from source! Check out perusio's excellent scripts Fetch required modules Create a compile script Create vhosts upstream phpcgi { server unix:/var/run/php-fpm.sock; }

Tune your stack PHP-FPM :~# apt-get install php5-fpm Create entry in /etc/php5/fpm/pool.d listen = /var/run/php-fpm.sock slowlog = log/$pool.log.slow request_slowlog_timeout = 4s /etc/init.d/php5-fpm start

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do)

Future Access memcached from nginx Write new memcached module (hack looks promising) Use ngx_http_enhanced_memcached_module (support headers, key hashing) Soft expiration? server-side locking (stampede protection)? Server side includes Puppet

Drupal Memcached Nginx 1

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do) 2

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do) 3

Technology overview Nginx PHP-FPM Memcached Xhprof Scrapy Siege 4

Nginx 1000 concurrent connection == normal Serves as a connection 'router' Advanced configuration (variables, control structures,...) Extend with modules http://nginx.org/ 5

PHP-FPM FastCGI Process Manager for PHP Werkt adhv configuratie 'pool' Elk item heeft eigen configuratie Unix socket of TCP poort per entry in pool Chroot http://php-fpm.org/ 6

Memcached Key value store Distributed Key max. 255 chars http://memcached.org/ 7 Socket forwarden naar poort: sudo socat -v UNIX-CONNECT:/tmp/memcache TCP- LISTEN:6666,reuseaddr

XHProf Profiler Time spend in each function (inclusive/exclusive wall time) Drill down in functions to pinpoint problems 8 Install and usage: http://techportal.ibuildings.com/2009/12/01/profilingwith-xhprof/

Scrapy Webscraper (Spider) Sites indexeren Spamlijsten aanleggen Xpath http://scrapy.org/ 9 Spider.py: from scrapy.selector import HtmlXPathSelector from scrapy.spider import BaseSpider from scrapy.http import Request DOMAIN = 'localhost' URL = 'http://%s' % DOMAIN class MySpider(BaseSpider): name = DOMAIN allowed_domains = [DOMAIN] start_urls = [ URL ] def parse(self, response): hxs = HtmlXPathSelector(response) for url in hxs.select('//a/@href').extract(): if not url.startswith('http://'): url= URL + url print url yield Request(url, callback=self.parse) scrapy runspider spider.py > urls.out

Siege Advanced 'Apache Benchmark' Crawl list of URL's Output: URL Responscode Time siege -c 100 -t 5m -b -i -f url-list.txt http://joedog.org/siege-home/ 10 Siege -c 100 -t 5m -b -i -f url-lijst.txt c => Concurrent users t => Tijd (5 minuten) B => Geen delay tussen requests i => Internet random select uit lijst f => File met URL's

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do) 11

Drupal optimization Optimize application Reduce server load Tune your stack 12

Drupal optimization Optimize application Reduce server load Tune your stack 13

Optimize application (1) First Turn pagecaching OFF Turn poormanscron OFF (bad UX) Turn on slow query log (Devel) while developing 14

Optimize application (2) Crawl site with Speedy Visit all URL's once with Siege Pipe output to file convert to CSV Response code 404's? Internal broken links 302? Extra hit on server! 500? Upstream server is down Tip: tail -f on errorlogs 15

Optimize application (3) Analyze slow pages XHProf Add caching where applicable (Block, Entity, Views, Webservice calls, ) Turn on php-fpm slowlog on test/production 16

Drupal optimization Optimize application Reduce server load Tune your stack 17

Reduce server load Minify Js Aggregate JS & CSS Turn ON pagecaching Correct cache headers CSS Sprites, use repeat-x/y (reduce size) Consider using CDN (CloudFront 0.12$/Gb) 18

Drupal optimization Optimize application Reduce server load Tune your stack 19

Tune your stack - Memcached Download & compile Memcached (daemon) Configure, make, make install Start: :~# memcached -u www-data -s /var/run/memcached.sock Use Unix socket if possible (local) 20 -Create socket first: sudo touch /var/run/memcached.pid -Settings

Tune your stack Memcached (2) Install php bindings Apt-get install php5-memcached Enable in php.ini Alter settings.php $conf['cache_backends'][] = './sites/all/modules/contrib/memcache/memcache.inc'; $conf['cache_default_class'] = 'MemCacheDrupal'; $conf['memcache_servers'] = array( ); 'unix:///var/run/memcached.sock' => 'default', 21

Tune your stack Nginx Compile from source! Check out perusio's excellent scripts Fetch required modules Create a compile script Create vhosts upstream phpcgi { server unix:/var/run/php-fpm.sock; } 22 Perusio's Nginx-Drupal scripts: https://github.com/perusio/drupal-with-nginx My build script: cd./nginx-1.3.0./configure \ --prefix=/opt/nginx \ --add-module=../ngx_devel_kit \ --add-module=../set-misc-nginx-module \ --add-module=../nginx-upload-progress-module \ --add-module=../nginx-upstream-fair \ --add-module=../ngx_http_enhanced_memcached_module \ --with-http_realip_module \ --with-http_ssl_module \ --with-file-aio \ --with-http_flv_module \ --with-http_mp4_module \ make make install cd /opt/nginx/conf/ rm./* -R cp /opt/nginx-sources/conf/*./ -R

Tune your stack PHP-FPM :~# apt-get install php5-fpm Create entry in /etc/php5/fpm/pool.d listen = /var/run/php-fpm.sock slowlog = log/$pool.log.slow request_slowlog_timeout = 4s /etc/init.d/php5-fpm start 23

Drupal, Memcached &Nginx Technology overview Drupal optimization Future (To Do) 24

Future Access memcached from nginx Write new memcached module (hack looks promising) Use ngx_http_enhanced_memcached_module (support headers, key hashing) Soft expiration? server-side locking (stampede protection)? Server side includes Puppet 25

26