High Performance
   WordPress
  WordCamp Jerusalem
   September 5, 2010
About Me

 Barry Abrahamson
 Systems Wrangler, Automattic
 http://barry.wordpress.com/contact-me/
WordPress.com
WordPress.com

 Launched in August 2005
WordPress.com

 Launched in August 2005
 ~13.5 million sites and 16 million users today
WordPress.com

 Launched in August 2005
 ~13.5 million sites and 16 million users today
 Over 2 billion HTTP requests per ...
WordPress.com

 Launched in August 2005
 ~13.5 million sites and 16 million users today
 Over 2 billion HTTP requests per ...
WordPress.com

 Launched in August 2005
 ~13.5 million sites and 16 million users today
 Over 2 billion HTTP requests per ...
What is Performance?
What is Performance?


  Speed - Serve each request as quickly as possible
What is Performance?


  Speed - Serve each request as quickly as possible
  Scaling - Serve many concurrent requests
Speed
Speed	
Server
Speed	
Server
  Generating the content
Speed	
Server
  Generating the content
Client
Speed	
Server
  Generating the content
Client
  Downloading
Speed	
Server
  Generating the content
Client
  Downloading
  Parsing
Speed	
Server
  Generating the content
Client
  Downloading
  Parsing
  Displaying
Speed	
Server
  Generating the content
Client
  Downloading
  Parsing
  Displaying
Client Side Performance
Client Side Performance
  80%+ of the total load time
Client Side Performance
  80%+ of the total load time
  Tools
Client Side Performance
  80%+ of the total load time
  Tools
    YSlow - http://developer.yahoo.com/yslow/
Client Side Performance
  80%+ of the total load time
  Tools
    YSlow - http://developer.yahoo.com/yslow/
    Page Speed...
Client Side Performance
Client Side Performance


Reduce number of HTTP Requests
Client Side Performance


Reduce number of HTTP Requests
Compress (gzip)
Client Side Performance


Reduce number of HTTP Requests
Compress (gzip)
Optimize images (resize, pngcrush, jpegtran)
Server Side Performance
Server Side Performance


More important than client side performance
Server Side Performance


More important than client side performance
Tools aren’t as advanced / fancy as client tools
Server Side Performance
Server Side Performance
Possible problems
Server Side Performance
Possible problems
  Slow database queries
Server Side Performance
Possible problems
  Slow database queries
  PHP (CPU)
Server Side Performance
Possible problems
  Slow database queries
  PHP (CPU)
  Network
Server Side Performance
Possible problems
  Slow database queries
  PHP (CPU)
  Network
Tools
Server Side Performance
Possible problems
  Slow database queries
  PHP (CPU)
  Network
Tools
  WordPress Plugins - Search...
WordPress.com Debug Tools
Server Side Performance
Server Side Performance	

Tools
Server Side Performance	

Tools
  MySQL Slow query log
Server Side Performance	

Tools
  MySQL Slow query log
  http://www.maatkit.org/doc/mk-query-digest.html
Server Side Performance	

Tools
  MySQL Slow query log
  http://www.maatkit.org/doc/mk-query-digest.html
  Strace / lsof /...
Server Side Performance	

Tools
  MySQL Slow query log
  http://www.maatkit.org/doc/mk-query-digest.html
  Strace / lsof /...
How can I improve
  performance?
As a User
As a User

Make sure you are running the latest WordPress!
As a User

Make sure you are running the latest WordPress!
  Constant performance improvements being made.
  Many from thi...
As a User

Make sure you are running the latest WordPress!
  Constant performance improvements being made.
  Many from thi...
As a User

Make sure you are running the latest WordPress!
  Constant performance improvements being made.
  Many from thi...
As a Sysadmin
As a Sysadmin

Opcode cache (APC)
As a Sysadmin

Opcode cache (APC)
Caching plugins (Batcache, WP super cache)
As a Sysadmin

Opcode cache (APC)
Caching plugins (Batcache, WP super cache)
Make sure you are running the latest PHP
As a Sysadmin

Opcode cache (APC)
Caching plugins (Batcache, WP super cache)
Make sure you are running the latest PHP
HipH...
As a Sysadmin

Opcode cache (APC)
Caching plugins (Batcache, WP super cache)
Make sure you are running the latest PHP
HipH...
Real World Numbers
Real World Numbers	

APC
Real World Numbers	

APC
 Empty cache - 33.5 MB RAM
Real World Numbers	

APC
 Empty cache - 33.5 MB RAM
 Primed cache - 6.2 MB RAM
Real World Numbers	

APC
 Empty cache - 33.5 MB RAM
 Primed cache - 6.2 MB RAM
 60% reduction in CPU utilization ( 2160 CP...
Real World Numbers	

APC
  Empty cache - 33.5 MB RAM
  Primed cache - 6.2 MB RAM
  60% reduction in CPU utilization ( 2160...
Real World Numbers
Real World Numbers

HipHop
Real World Numbers

HipHop
 40% faster ( http://huichen.org/en/2010/06/
 wordpress-3-benchmark/ )
Real World Numbers

HipHop
 40% faster ( http://huichen.org/en/2010/06/
 wordpress-3-benchmark/ )
 270% faster ( http://hu...
Real World Numbers
Apache + mod_php

1 request requiring php


  Using mod_php, php is
  loaded for every request
  even if not needed
  Most...
As a Developer
As a Developer


Only perform write operations when needed. Example
is flushing rewrite rules on every page load
As a Developer


Only perform write operations when needed. Example
is flushing rewrite rules on every page load
Use WordPr...
WordPress.com
WordPress.com

 ~ 1100 servers in 3 datacenters
 ~ 450 web servers (8 CPU cores)
 ~ 400 database servers (lots of SSDs)
 ~...
Scaling Tips
Scaling Tips

  Most things you do to scale WordPress apply to
  any web app
Scaling Tips

  Most things you do to scale WordPress apply to
  any web app
  If your bottleneck is the database, somethi...
Scaling Tips

  Most things you do to scale WordPress apply to
  any web app
  If your bottleneck is the database, somethi...
Scaling Tips

  Most things you do to scale WordPress apply to
  any web app
  If your bottleneck is the database, somethi...
Questions?
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010
Upcoming SlideShare
Loading in...5
×

High Performance WordPress - WordCamp Jerusalem 2010

3,504

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,504
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
29
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide














  • Serving lots of viruses quickly is not the kind of performance we want!
  • Serving lots of viruses quickly is not the kind of performance we want!


































































































  • Talk about most common scaling problem. Database connection errors.
















  • High Performance WordPress - WordCamp Jerusalem 2010

    1. 1. High Performance WordPress WordCamp Jerusalem September 5, 2010
    2. 2. About Me Barry Abrahamson Systems Wrangler, Automattic http://barry.wordpress.com/contact-me/
    3. 3. WordPress.com
    4. 4. WordPress.com Launched in August 2005
    5. 5. WordPress.com Launched in August 2005 ~13.5 million sites and 16 million users today
    6. 6. WordPress.com Launched in August 2005 ~13.5 million sites and 16 million users today Over 2 billion HTTP requests per day
    7. 7. WordPress.com Launched in August 2005 ~13.5 million sites and 16 million users today Over 2 billion HTTP requests per day Billions of MySQL queries per month
    8. 8. WordPress.com Launched in August 2005 ~13.5 million sites and 16 million users today Over 2 billion HTTP requests per day Billions of MySQL queries per month 500TB of bandwidth per week
    9. 9. What is Performance?
    10. 10. What is Performance? Speed - Serve each request as quickly as possible
    11. 11. What is Performance? Speed - Serve each request as quickly as possible Scaling - Serve many concurrent requests
    12. 12. Speed
    13. 13. Speed Server
    14. 14. Speed Server Generating the content
    15. 15. Speed Server Generating the content Client
    16. 16. Speed Server Generating the content Client Downloading
    17. 17. Speed Server Generating the content Client Downloading Parsing
    18. 18. Speed Server Generating the content Client Downloading Parsing Displaying
    19. 19. Speed Server Generating the content Client Downloading Parsing Displaying
    20. 20. Client Side Performance
    21. 21. Client Side Performance 80%+ of the total load time
    22. 22. Client Side Performance 80%+ of the total load time Tools
    23. 23. Client Side Performance 80%+ of the total load time Tools YSlow - http://developer.yahoo.com/yslow/
    24. 24. Client Side Performance 80%+ of the total load time Tools YSlow - http://developer.yahoo.com/yslow/ Page Speed - http://code.google.com/speed/ page-speed/
    25. 25. Client Side Performance
    26. 26. Client Side Performance Reduce number of HTTP Requests
    27. 27. Client Side Performance Reduce number of HTTP Requests Compress (gzip)
    28. 28. Client Side Performance Reduce number of HTTP Requests Compress (gzip) Optimize images (resize, pngcrush, jpegtran)
    29. 29. Server Side Performance
    30. 30. Server Side Performance More important than client side performance
    31. 31. Server Side Performance More important than client side performance Tools aren’t as advanced / fancy as client tools
    32. 32. Server Side Performance
    33. 33. Server Side Performance Possible problems
    34. 34. Server Side Performance Possible problems Slow database queries
    35. 35. Server Side Performance Possible problems Slow database queries PHP (CPU)
    36. 36. Server Side Performance Possible problems Slow database queries PHP (CPU) Network
    37. 37. Server Side Performance Possible problems Slow database queries PHP (CPU) Network Tools
    38. 38. Server Side Performance Possible problems Slow database queries PHP (CPU) Network Tools WordPress Plugins - Search for “debug”
    39. 39. WordPress.com Debug Tools
    40. 40. Server Side Performance
    41. 41. Server Side Performance Tools
    42. 42. Server Side Performance Tools MySQL Slow query log
    43. 43. Server Side Performance Tools MySQL Slow query log http://www.maatkit.org/doc/mk-query-digest.html
    44. 44. Server Side Performance Tools MySQL Slow query log http://www.maatkit.org/doc/mk-query-digest.html Strace / lsof / gdb
    45. 45. Server Side Performance Tools MySQL Slow query log http://www.maatkit.org/doc/mk-query-digest.html Strace / lsof / gdb Many times plugins are the culprit.
    46. 46. How can I improve performance?
    47. 47. As a User
    48. 48. As a User Make sure you are running the latest WordPress!
    49. 49. As a User Make sure you are running the latest WordPress! Constant performance improvements being made. Many from things found on WordPress.com
    50. 50. As a User Make sure you are running the latest WordPress! Constant performance improvements being made. Many from things found on WordPress.com Show a reasonable number of posts per page. 10-25 seems to be good
    51. 51. As a User Make sure you are running the latest WordPress! Constant performance improvements being made. Many from things found on WordPress.com Show a reasonable number of posts per page. 10-25 seems to be good Monitor site performance
    52. 52. As a Sysadmin
    53. 53. As a Sysadmin Opcode cache (APC)
    54. 54. As a Sysadmin Opcode cache (APC) Caching plugins (Batcache, WP super cache)
    55. 55. As a Sysadmin Opcode cache (APC) Caching plugins (Batcache, WP super cache) Make sure you are running the latest PHP
    56. 56. As a Sysadmin Opcode cache (APC) Caching plugins (Batcache, WP super cache) Make sure you are running the latest PHP HipHop
    57. 57. As a Sysadmin Opcode cache (APC) Caching plugins (Batcache, WP super cache) Make sure you are running the latest PHP HipHop Apache + mod_php < Nginx + php-fpm.
    58. 58. Real World Numbers
    59. 59. Real World Numbers APC
    60. 60. Real World Numbers APC Empty cache - 33.5 MB RAM
    61. 61. Real World Numbers APC Empty cache - 33.5 MB RAM Primed cache - 6.2 MB RAM
    62. 62. Real World Numbers APC Empty cache - 33.5 MB RAM Primed cache - 6.2 MB RAM 60% reduction in CPU utilization ( 2160 CPUs )
    63. 63. Real World Numbers APC Empty cache - 33.5 MB RAM Primed cache - 6.2 MB RAM 60% reduction in CPU utilization ( 2160 CPUs ) PHP 5.3.3 10% CPU reduction ( 360 CPUs )
    64. 64. Real World Numbers
    65. 65. Real World Numbers HipHop
    66. 66. Real World Numbers HipHop 40% faster ( http://huichen.org/en/2010/06/ wordpress-3-benchmark/ )
    67. 67. Real World Numbers HipHop 40% faster ( http://huichen.org/en/2010/06/ wordpress-3-benchmark/ ) 270% faster ( http://huichen.org/en/2010/06/ wordpress-3-benchmark-part-2/ )
    68. 68. Real World Numbers
    69. 69. Apache + mod_php 1 request requiring php Using mod_php, php is loaded for every request even if not needed Most scaling problems are because of this
    70. 70. As a Developer
    71. 71. As a Developer Only perform write operations when needed. Example is flushing rewrite rules on every page load
    72. 72. As a Developer Only perform write operations when needed. Example is flushing rewrite rules on every page load Use WordPress functions when possible.
    73. 73. WordPress.com
    74. 74. WordPress.com ~ 1100 servers in 3 datacenters ~ 450 web servers (8 CPU cores) ~ 400 database servers (lots of SSDs) ~ 75 memcached servers (800GB of RAM)
    75. 75. Scaling Tips
    76. 76. Scaling Tips Most things you do to scale WordPress apply to any web app
    77. 77. Scaling Tips Most things you do to scale WordPress apply to any web app If your bottleneck is the database, something is wrong
    78. 78. Scaling Tips Most things you do to scale WordPress apply to any web app If your bottleneck is the database, something is wrong Measure twice, cut once, measure again
    79. 79. Scaling Tips Most things you do to scale WordPress apply to any web app If your bottleneck is the database, something is wrong Measure twice, cut once, measure again Don’t optimize if you don’t need to
    80. 80. Questions?
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×