SlideShare a Scribd company logo
HIGH PERFORMANCE
                 WordPress
                  Iliya Polihronov
                  WordCamp San Francisco 2012

Saturday, August 4, 12
Iliya
       Polihronov
       Systems Wrangler
       Automattic




       polihronov.wordpress.com
       slideshare.net/vnsavage
                @vnsavage

Saturday, August 4, 12
WordPress.com
            Numbers

             ‣ 115 million pageviews per day

             ‣ 2.6 billion requests per day

             ‣ over 200 plugins

             ‣ 500ms per page


Saturday, August 4, 12
Notable Users




Saturday, August 4, 12
Services Installation
            Nginx                   wiki.nginx.org/Install

            PHP-FPM                 Compile PHP with --enable-fpm

            For Debian Squeeze
            $ gpg --keyserver   hkp://keys.gnupg.net --recv-keys E9C74FEEA2098A6E
            $ gpg --keyserver   hkp://keys.gnupg.net --recv-keys ABF5BD827BD9BF62
            $ gpg -a --export E9C74FEEA2098A6E | apt-key add -
            $ gpg -a --export ABF5BD827BD9BF62 | apt-key add -
            $ echo 'deb http://nginx.org/packages/debian/ squeeze nginx' >> /etc/apt/sources.list
            $ echo 'deb http://packages.dotdeb.org squeeze-php54 all' >> /etc/apt/sources.list
            $ apt-get update
            $ apt-get install nginx php5-cli php5-fpm php5-cgi php5-mysql php5-memcache




Saturday, August 4, 12
Services Installation
            APC                php.net/manual/en/apc.installation.php


            MySQL              percona.com/doc/percona-server/5.5/installation.html


            Memcached                   memcached.org


            For Debian Squeeze
            $ gpg --keyserver   hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
            $ gpg -a --export CD2EFD2A | apt-key add -
            $ echo ‘deb http://repo.percona.com/apt squeeze main’ >> /etc/apt/sources.list
            $ apt-get update
            $ apt-get install php5-apc memcached percona-server-server-5.5 percona-server-client-5.5




Saturday, August 4, 12
Nginx Configuration
            /etc/nginx/nginx.conf

            worker_processes 8;
            worker_connections 2048;
            keepalive_timeout 30;

            gzip on;
            gzip_types text/css text/javascript application/x-javascript application/json text/xml;
            gzip_min_length 500;
            gzip_comp_level 5;

            location ~ .(css|js|jp(e)?g|gif|png|swf|ico)$   {
               expires 1y;
            }

            fastcgi_buffer_size 32k;
            fastcgi_buffers 256 4k;

            /etc/init.d/nginx

            ulimit -n 65536

            Full configuration at polihronov.wordpress.com


Saturday, August 4, 12
PHP-FPM and APC
            /etc/php5/fpm/pool.d/www.conf

            pm = dynamic
            pm.max_children = 40
            pm.start_servers = 5
            pm.min_spare_servers = 5
            pm.max_spare_servers = 10
            listen.backlog = 512

            /etc/php5/conf.d/20-apc.ini

            extension="apc.so"
            apc.enabled = 1
            apc.shm_size = 32M

            /etc/php5/fpm/php.ini

            output_buffering = 4096




Saturday, August 4, 12
MySQL Configuration
            /etc/mysql/my.cnf

            key_buffer = 256M
            sort_buffer_size = 4M
            read_buffer_size = 4M
            innodb_buffer_pool_size = 256M
            innodb_log_buffer_size = 8M

            tmp_table_size = 32M
            max_heap_table_size = 32M

            table_cache = 128
            thread_cache = 64

            query_cache_type = 1
            query_cache_limit = 1M
            query_cache_size = 32M

            InnoDB - for tables with lots of reads and writes
            mysqlreport - inspect important MySQL status values




Saturday, August 4, 12
Optimizing your
            WordPress Install

            ‣ Keep it up to date

            ‣ Avoid unnecessary plugins

            ‣ Avoid slow plugins
                  http://wordpress.org/extend/plugins/p3-profiler



Saturday, August 4, 12
Caching

            Memcached Object Cache
            http://wordpress.org/extend/plugins/memcached/




            WP Super Cache
            http://wordpress.org/extend/plugins/wp-super-cache/

            ‣ Custom permalinks, like /%year/%monthnum%/%postname%/
            ‣ Enable all the recommended settings



Saturday, August 4, 12
Benchmarks
            Virtual machine on a laptop, using Apache Benchmark (ab):


            Without APC

               11.07 REQUESTS/SEC

            With APC

                 48.39 REQUESTS/SEC

            With APC and Caching

                                                16,140.70 REQUESTS/SEC


Saturday, August 4, 12
At a Larger Scale

                         INTERNET

                                                  Load Balancers




                                    Web Servers   Caching Servers   Web Servers




                                     Memcached
                                                        Master-Slave MySQL

Saturday, August 4, 12
Questions?
                         HIGH PERFORMANCE
                         WordPress

Saturday, August 4, 12
Iliya
       Polihronov
       Systems Wrangler
       Automattic




       polihronov.wordpress.com
       slideshare.net/vnsavage
                @vnsavage

Saturday, August 4, 12

More Related Content

ODP
Introduction to Ansible
PDF
Room 3 - 1 - Nguyễn Xuân Trường Lâm - Zero touch on-premise storage infrastru...
PPTX
Hp open view(hp ov)
PPTX
Jenkins tutorial
PPTX
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
PPTX
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
PDF
Ansible
Introduction to Ansible
Room 3 - 1 - Nguyễn Xuân Trường Lâm - Zero touch on-premise storage infrastru...
Hp open view(hp ov)
Jenkins tutorial
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible

What's hot (20)

PPTX
Git undo
PPTX
Maven ppt
PDF
AWS Systems Manager
PDF
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
PPT
Maven Introduction
PPSX
CI-CD Jenkins, GitHub Actions, Tekton
PDF
Ansible Introduction
PPTX
Red Hat Openshift Fundamentals.pptx
PDF
DevOps with GitHub Actions
PDF
Vue, vue router, vuex
PDF
Lecture5 virtualization
PDF
CI/CD with Github Actions
PDF
Livre blanc docker
PPTX
Express js
ODP
Basics of VueJS
PPT
Java Servlets
PPTX
Microsoft Active Directory.pptx
PDF
AWS와 Open Source - 윤석찬 (OSS개발자 그룹)
PPTX
Using GitHub Actions to Deploy your Workloads to Azure
Git undo
Maven ppt
AWS Systems Manager
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Maven Introduction
CI-CD Jenkins, GitHub Actions, Tekton
Ansible Introduction
Red Hat Openshift Fundamentals.pptx
DevOps with GitHub Actions
Vue, vue router, vuex
Lecture5 virtualization
CI/CD with Github Actions
Livre blanc docker
Express js
Basics of VueJS
Java Servlets
Microsoft Active Directory.pptx
AWS와 Open Source - 윤석찬 (OSS개발자 그룹)
Using GitHub Actions to Deploy your Workloads to Azure
Ad

Viewers also liked (20)

KEY
WCSF 2012 - All You Can Eat Content Types
KEY
bbPress - WCSF 2012
PPT
WordPress SEO Revisited by Lou Anne McKeefery of Be Found
PDF
Git Version Control for the Complete N00b by Adam LaBarge
PDF
WordPress Gallery tutorial
PDF
Is Your (Client's) Website Ready for 2017?
PDF
WordPress and Business Intelligence
PDF
State of Mobile
PDF
Designing for The Modern Web
PDF
WordPress State of the Word 2012
PDF
Nginx & php fpm - the webserver you might actually like - php usergroup berlin
PDF
WordPress for Nonprofits Using CiviCRM
PPTX
PHP conference Berlin 2015: running PHP on Nginx
PDF
Sallie Goetsch: Making the Events Calendar Sit Up and Beg
PDF
PhpStorm for WordPress
PDF
Rob La Gatta; Making the Events Calendar Sit Up and Beg
PDF
WordPress Comments (November Meetup)
PDF
Making WordPress Easier to Use
PDF
AWS Cloudfront Howto
PDF
Real Developer Tools for WordPress by Stefan Didak
WCSF 2012 - All You Can Eat Content Types
bbPress - WCSF 2012
WordPress SEO Revisited by Lou Anne McKeefery of Be Found
Git Version Control for the Complete N00b by Adam LaBarge
WordPress Gallery tutorial
Is Your (Client's) Website Ready for 2017?
WordPress and Business Intelligence
State of Mobile
Designing for The Modern Web
WordPress State of the Word 2012
Nginx & php fpm - the webserver you might actually like - php usergroup berlin
WordPress for Nonprofits Using CiviCRM
PHP conference Berlin 2015: running PHP on Nginx
Sallie Goetsch: Making the Events Calendar Sit Up and Beg
PhpStorm for WordPress
Rob La Gatta; Making the Events Calendar Sit Up and Beg
WordPress Comments (November Meetup)
Making WordPress Easier to Use
AWS Cloudfront Howto
Real Developer Tools for WordPress by Stefan Didak
Ad

Similar to High Performance WordPress (20)

ODP
Award-winning technology: Oxid loves the query cache
DOCX
How to install and configure LEMP stack
KEY
Site Performance - From Pinto to Ferrari
ODP
Caching and tuning fun for high scalability
PPTX
Nginx [engine x] and you (and WordPress)
PDF
Scaling WordPress
PDF
10 Million hits a day with WordPress using a $15 VPS
PDF
Running PHP on nginx
PDF
Sofia WP User Group Presentation
ODP
Caching and tuning fun for high scalability @ FOSDEM 2012
PDF
Scale Apache with Nginx
PDF
Nginx pres
PDF
Cache all the things - A guide to caching Drupal
PPTX
Web Front End Performance
PDF
161208
PPTX
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PDF
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
ODP
Website releases made easy with the PEAR installer, OSCON 2009
PDF
Converting Your Dev Environment to a Docker Stack - php[world]
PDF
OSCP Preparation Guide @ Infosectrain
Award-winning technology: Oxid loves the query cache
How to install and configure LEMP stack
Site Performance - From Pinto to Ferrari
Caching and tuning fun for high scalability
Nginx [engine x] and you (and WordPress)
Scaling WordPress
10 Million hits a day with WordPress using a $15 VPS
Running PHP on nginx
Sofia WP User Group Presentation
Caching and tuning fun for high scalability @ FOSDEM 2012
Scale Apache with Nginx
Nginx pres
Cache all the things - A guide to caching Drupal
Web Front End Performance
161208
PHP on Heroku: Deploying and Scaling Apps in the Cloud
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Website releases made easy with the PEAR installer, OSCON 2009
Converting Your Dev Environment to a Docker Stack - php[world]
OSCP Preparation Guide @ Infosectrain

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Modernizing your data center with Dell and AMD
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PDF
Approach and Philosophy of On baking technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Empathic Computing: Creating Shared Understanding
20250228 LYD VKU AI Blended-Learning.pptx
Modernizing your data center with Dell and AMD
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
Review of recent advances in non-invasive hemoglobin estimation
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
Approach and Philosophy of On baking technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

High Performance WordPress

  • 1. HIGH PERFORMANCE WordPress Iliya Polihronov WordCamp San Francisco 2012 Saturday, August 4, 12
  • 2. Iliya Polihronov Systems Wrangler Automattic polihronov.wordpress.com slideshare.net/vnsavage @vnsavage Saturday, August 4, 12
  • 3. WordPress.com Numbers ‣ 115 million pageviews per day ‣ 2.6 billion requests per day ‣ over 200 plugins ‣ 500ms per page Saturday, August 4, 12
  • 5. Services Installation Nginx wiki.nginx.org/Install PHP-FPM Compile PHP with --enable-fpm For Debian Squeeze $ gpg --keyserver hkp://keys.gnupg.net --recv-keys E9C74FEEA2098A6E $ gpg --keyserver hkp://keys.gnupg.net --recv-keys ABF5BD827BD9BF62 $ gpg -a --export E9C74FEEA2098A6E | apt-key add - $ gpg -a --export ABF5BD827BD9BF62 | apt-key add - $ echo 'deb http://nginx.org/packages/debian/ squeeze nginx' >> /etc/apt/sources.list $ echo 'deb http://packages.dotdeb.org squeeze-php54 all' >> /etc/apt/sources.list $ apt-get update $ apt-get install nginx php5-cli php5-fpm php5-cgi php5-mysql php5-memcache Saturday, August 4, 12
  • 6. Services Installation APC php.net/manual/en/apc.installation.php MySQL percona.com/doc/percona-server/5.5/installation.html Memcached memcached.org For Debian Squeeze $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A $ gpg -a --export CD2EFD2A | apt-key add - $ echo ‘deb http://repo.percona.com/apt squeeze main’ >> /etc/apt/sources.list $ apt-get update $ apt-get install php5-apc memcached percona-server-server-5.5 percona-server-client-5.5 Saturday, August 4, 12
  • 7. Nginx Configuration /etc/nginx/nginx.conf worker_processes 8; worker_connections 2048; keepalive_timeout 30; gzip on; gzip_types text/css text/javascript application/x-javascript application/json text/xml; gzip_min_length 500; gzip_comp_level 5; location ~ .(css|js|jp(e)?g|gif|png|swf|ico)$ { expires 1y; } fastcgi_buffer_size 32k; fastcgi_buffers 256 4k; /etc/init.d/nginx ulimit -n 65536 Full configuration at polihronov.wordpress.com Saturday, August 4, 12
  • 8. PHP-FPM and APC /etc/php5/fpm/pool.d/www.conf pm = dynamic pm.max_children = 40 pm.start_servers = 5 pm.min_spare_servers = 5 pm.max_spare_servers = 10 listen.backlog = 512 /etc/php5/conf.d/20-apc.ini extension="apc.so" apc.enabled = 1 apc.shm_size = 32M /etc/php5/fpm/php.ini output_buffering = 4096 Saturday, August 4, 12
  • 9. MySQL Configuration /etc/mysql/my.cnf key_buffer = 256M sort_buffer_size = 4M read_buffer_size = 4M innodb_buffer_pool_size = 256M innodb_log_buffer_size = 8M tmp_table_size = 32M max_heap_table_size = 32M table_cache = 128 thread_cache = 64 query_cache_type = 1 query_cache_limit = 1M query_cache_size = 32M InnoDB - for tables with lots of reads and writes mysqlreport - inspect important MySQL status values Saturday, August 4, 12
  • 10. Optimizing your WordPress Install ‣ Keep it up to date ‣ Avoid unnecessary plugins ‣ Avoid slow plugins http://wordpress.org/extend/plugins/p3-profiler Saturday, August 4, 12
  • 11. Caching Memcached Object Cache http://wordpress.org/extend/plugins/memcached/ WP Super Cache http://wordpress.org/extend/plugins/wp-super-cache/ ‣ Custom permalinks, like /%year/%monthnum%/%postname%/ ‣ Enable all the recommended settings Saturday, August 4, 12
  • 12. Benchmarks Virtual machine on a laptop, using Apache Benchmark (ab): Without APC 11.07 REQUESTS/SEC With APC 48.39 REQUESTS/SEC With APC and Caching 16,140.70 REQUESTS/SEC Saturday, August 4, 12
  • 13. At a Larger Scale INTERNET Load Balancers Web Servers Caching Servers Web Servers Memcached Master-Slave MySQL Saturday, August 4, 12
  • 14. Questions? HIGH PERFORMANCE WordPress Saturday, August 4, 12
  • 15. Iliya Polihronov Systems Wrangler Automattic polihronov.wordpress.com slideshare.net/vnsavage @vnsavage Saturday, August 4, 12