Your SlideShare is downloading. ×
Roy foubister (hosting high traffic sites on a tight budget)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Roy foubister (hosting high traffic sites on a tight budget)

1,966
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,966
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Thanks for introduction..
  • Thanks for introduction..
  • Transcript

    • 1. Hosting High Traffic Sites on a tight Budget on a tight Budget
      • or
      • Getting ONE server to stay up while you are able to get a good night’s sleep!
    • 2. Who is this guy?
    • 3. A little story : keo.co.za - 28k comments a month - Peaked at 58k
    • 4. Ryan Allen's 12.4 step process - 20 blogs - 850,000+ pages a day - 25 million / month
    • 5. Whats the point
      • - Getting a server to use a 3rd of the resources
      • - Delivering 5 x the amount of pages
    • 6. The brief
      • Big publishing client - social site “next big thing”
      • - Image
      • - Music
      • - Video
      • - Must be fast
      • - 99% uptime
      • - Easy to maintain
    • 7. The development
      • Wire frames > design > development
      • The dev goes smooth on a local dev box
      • Client says right make it live.
    • 8. Production Server
      • Order the linux server from the hosting co.
      • Ubuntu 11.04 installed with LAMP - Sounds great!!
      • Sounds good, right - Linux can handle anything, its the greatest thing since duck tape!
      • The media release goes out and the people start flooding to the site.
    • 9. CRASH
      • Oh hell - the sites response is slow
      • “ Duck it” the site is down!!!
      • You try connect to it with SSH - nothing, no pings - IT'S GONE!
      • Call the hosting company - please hard reboot our server :|
      • Client breathing fire your way!
    • 10. WTF just happened?
      • Hardware resources are finite - the default install of LAMP will let you down under load.
      • Resource bottle necks
      • CPU - Dynamic generated pages, mysql
      • Memory - PHP, cache, mysql
      • Disk - Files, static content, file pointers
      • Network - Static content, dynamic content
    • 11. Make it simple!
      • Optimizing can get out of control, some simple changes can make a big difference.
      • - Use products that have community support
      • - Use products that are expected by by your team
      • Think about the full process from server to rendering in the browser.
    • 12. Test Server time
      • - Ubuntu 11.04 install
      • - Intel Pentium Dual CPU E2180 @ 2.00GHz / 4Gb ram
      • - PHP 5.3 / MYSQL 5.1
      • - WordPress 3.2.1
      • - Twentyeleven default theme / WP theme test data
      • Please send donations for
      • new test server equipment!!! :)
    • 13. Apache
      • Default install of Apache-prefork max clients = 150 (can set up to 256 before having to recompile)
      • mod_php
      • Keep alive default is 15 - set it to 5 seconds!
      • Apache ready
      • Options:
      • - apache-worker with php on fast-cgi - have fun!
    • 14. Mysql
      • Default settings - new versions of Ubuntu have query cache turned on - this saved my butt on keo.co.za
      • MyISAM or InnoDB = WP performance almost the same with query cache turned on!
      • Mysql ready
      • Very cool Mysql tuning scripts on git hub - help set the settings from reading your server stats.
    • 15. Hammer time
      • # ab -k -n1000 -c150 http://wptest.dev/index.php
      • Apache bench - comes with apache.
      • -n 1000 hit the site 1000 times!
      • -c 150 concurrent hits (apache max clients at 150)
      • -k try set keep alive
    • 16. Warning : load 108! What??
      • Got 12 pages/sec out in 81 seconds, Load?
    • 17. APC to the rescue. Not...
      • OK, lets OP cache - preprocess all the PHP scripts and cache them in machine code.
      • hmmm - run test -> load spikes to 104 -> 12 pages/sec
      • Not much help
      • (I know there is more to APC - but not fresh install!!)
    • 18. Jump Tests!!!
      • - Get system stats?
      • - I only have one Hard drive in the server
          • What if its a disk IO issue?
    • 19. RAM drive
      • This is not an installation procedure!
      • Create copy files over to memory drive
      • - Be brave and run this in production
      • - Shoot your self in the foot
      • - Feels the same?
    • 20. Got it - load 40 @ 53 req/s
      • Blazing fast performance!
      • Same task completed in 17 seconds - 400% improvement!!!
      • Now do it in a safe way! WP pick your cache!!!
      • WP CACHE
      • WP SUPER CACHE
      • W3 TOTAL CACHE
      • What to name the next cache!!!
    • 21. w3 Total cache
      • This was suggested by the Joyent cloud developers
      • Options -
      • - Object
      • - Pages
      • - etc.....
      • Remove the Ram drive, install and activate just object cache,
      • Server load 40 @ 40 req/s - finished in 24 seconds..... nice
    • 22. Cache’ing out!
      • Turned on the total cache
      • - objects, pages, etc....
      • Server load 33 @ 61 req/s
      • - finished in 16 seconds..... Blistering!!!
      • 500% improvement!!!
    • 23. The change
    • 24. Split off static content Simple - define content url in the wp-config.php
    • 25. Nginx & DNS
      • - Bind to second IP on the same server
      • - webroot to the same as apache webroot
      • - return all media files.
    • 26. Gain?
      • - 1 call to Apache - PHP
      • - 8 calls to Nginx - no cookie, no resource hit!
    • 27. Next step - Nginx proxy??
      • Setup Nginx to proxy dynamic calls to Apache on localhost and deliver static content itself.
      • Caution - plugins and client IP addresses.... Test, Test, etc....
    • 28. Simplicity, don’t over do it!
    • 29. Thank you! Any Questions? FormFunction Digital Consultants (Pty) Ltd +27 21 462 0257 www.twitter.com/formfunction www.formfunction.co.za Roy Foubister [email_address] Skype: roy-osoutsource twitter.com/fobroster