15

Click here to load reader

Roshan Bhattarai: Scaling WordPress for high traffic sites

  • Upload
    wpnepal

  • View
    1.840

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Roshan Bhattarai: Scaling WordPress for high traffic sites

Scaling WordPress for High Traffic

Page 2: Roshan Bhattarai: Scaling WordPress for high traffic sites

Roshan Bhattarai

• Father

• Author - (Co-author : PHP Ajax Cookbook )

• Software Developer

• And so called CTO @ proshore

Page 3: Roshan Bhattarai: Scaling WordPress for high traffic sites

Optimization Tips for Shared hosting

• Use W3 Total Cache plugin for caching page and datas .

• Serve all the static contents(JavaScript , CSS files and Images ) from Content Delivery Network.

• Use jQuery lazy load plugin to server images if there are many.

• Minify and Gzip the CSS and and JavaScript files. • For big number of posts and comment table use

MySQL’s logical partition. http://pento.net/2011/04/28/partitioning-the-wordpress-comments-table/

Page 4: Roshan Bhattarai: Scaling WordPress for high traffic sites

W3 Total Cache

Main Features :

• Page Caching

• Minify

• Database Caching

• Headers: W3TC manages the HTTP headers (cache-control, expires)

• Content Delivery Network (CDN )

Page 5: Roshan Bhattarai: Scaling WordPress for high traffic sites

Content Delivery Network

• Serving static content directly from own server

• Uploading static files to server and serving from there

Page 6: Roshan Bhattarai: Scaling WordPress for high traffic sites

Still problem ………………..

Time to move to VPS or Dedicated Server

Page 7: Roshan Bhattarai: Scaling WordPress for high traffic sites

Recommended Server Configuration

• Use Nginx Web Server than Apache• Use Varnish or Squid (Reverse Proxy Servers )for

serving static content over Nginx server• Use PHP-FMP (FastCGI Process Manager) • Implement Sphinx search engine or Lucene

Search Engine for full text search on database. • As always use CDN • Use Opcode Cache Engine for W3 Total Cache (

APC recommended)

Page 8: Roshan Bhattarai: Scaling WordPress for high traffic sites

That should be able to cope around 10 million hits a day on normal

Wordpress website.

http://www.ewanleith.com/blog/900/10-million-hits-a-day-with-wordpress-

using-a-15-server

Page 9: Roshan Bhattarai: Scaling WordPress for high traffic sites

Still high CPU and memory ususage on server

Time to use multiple HTTP servers and multiple database servers.

Page 10: Roshan Bhattarai: Scaling WordPress for high traffic sites

Using Load balancer

Page 11: Roshan Bhattarai: Scaling WordPress for high traffic sites

Load Balancing Technique

• Round Robin DNS

• Software Load balancer ( recommended HaProxy)

• Hardware load Balancing ( Cisco , Citrix etc )

Note : Use NFS to store static files and data on database.

Page 12: Roshan Bhattarai: Scaling WordPress for high traffic sites

Database Replication

Page 13: Roshan Bhattarai: Scaling WordPress for high traffic sites

Database Sharding

Software used for sharding MySQL : HiveDB

Page 14: Roshan Bhattarai: Scaling WordPress for high traffic sites

For WordPress use HyperDB

• Ability to use multiple databases.

• Supports partition of data.

• Supports replication.

• Supports failover.

Page 15: Roshan Bhattarai: Scaling WordPress for high traffic sites

Thank you for listening

Any questions?