Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
LAMPTo speed things up a bit
Going Beyond....
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Going beyond shared hosts
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
WHERE TO PLAY?
CheapVPS/DedicatedBox
Vagra...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
LAMP
Linux
Apache
MySQL
PHP
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
L[AMP]
Linux
Apache
MySQL
PHP
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
WIMP
Windows
IIS
MySQL
PHP
REALLY!!!
OMG Y...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
[AMP]
“Use the best tool for the job...
.....
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
[AMP]
“You don’t dig latrines with a swiss...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
ANGINX HTTP and Proxy
Server
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
AApache is like Microsoft Word, it has a m...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
MMaria DB & Percona
Server
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
PHipHop Virtual Machine
(HHVM)
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
P
<?hh
function yieldInfiniteInts(): Conti...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
P
async function getAsyncTemplatePart( $sl...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Key value stores
Memcached and Redis (Redi...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
id user_login user_pass user_nicename user...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Key : Value : Expiry (Optional)
!
Tim : Ge...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
WHAT ARE THEY GOOD FOR IN WORDPRESS?
Stori...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Memory comes and goes
especially with age!
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Transients API
Key : Value : Expiry (Optio...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Using KSV to cache
WordPress
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Rendering/ Template/Theme
Processing/ Obje...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Page/Fragment Caching
Object Caching
Query...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Caching can and will
screw with you!
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Queue Management
Beanstalkd & Gearman
(Ama...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk
1. WordPress sends job to queue
2. Job Server (Beanstalk, Gea...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk
1. User clicks approve on a comment,
WordPress queries the da...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
function gatherTemplateParts( $templates )...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
$worker = new GearmanWorker();
$worker->ad...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Caching reverse proxies
Varnish
(CloudFron...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
CLOUDFRONT
NGINX
(ORIGIN)
NGINX
Server
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
VARNISH
NGINX
(ORIGIN)
PROXY CACHING OVER ...
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
Caching can and will
screw with you!
COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012
TimNash.co.uk @tnash #beyondLAMP
TheEnd!
Thanks for listening and don’t for...
Upcoming SlideShare
Loading in …5
×

Going Beyond LAMP Again - Manchester WordPress User Group

  • Login to see the comments

  • Be the first to like this

Going Beyond LAMP Again - Manchester WordPress User Group

  1. 1. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP LAMPTo speed things up a bit Going Beyond...
  2. 2. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Going beyond shared hosts
  3. 3. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP WHERE TO PLAY? CheapVPS/DedicatedBox Vagrant Usethirdpartyservices PAAShosting
  4. 4. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP LAMP Linux Apache MySQL PHP
  5. 5. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP L[AMP] Linux Apache MySQL PHP
  6. 6. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP WIMP Windows IIS MySQL PHP REALLY!!! OMG You like Serious init! CRAZY??
  7. 7. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP [AMP] “Use the best tool for the job... ...Not just the most popular” - almost certainly an engineer
  8. 8. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP [AMP] “You don’t dig latrines with a swiss army knife”
  9. 9. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP ANGINX HTTP and Proxy Server
  10. 10. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP AApache is like Microsoft Word, it has a million options but you only need six. Nginx does those six things, and it does five of them 50 times faster than Apache. - Chris Lea (https://chrislea.com/)
  11. 11. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP MMaria DB & Percona Server
  12. 12. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP PHipHop Virtual Machine (HHVM)
  13. 13. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP P <?hh function yieldInfiniteInts(): Continuation<int> {   $i = 0;   while (true) {     yield $i++;   } } ! $generator = yieldInfiniteInts(); foreach ($generator as $value) {   echo "$valuen"; } http://docs.hhvm.com/manual/en/hack.continuations.php
  14. 14. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP P async function getAsyncTemplatePart( $slug, $name = false ) { return get_template_part( $slug, $name ); } ! async function gatherTemplateParts($templates) { $return = array(); ! foreach( $templates as $slug => $name ) { $return[] = getAsyncTemplatePart( $slug, $name ); } ! await GenArrayWaitHandle::create($return); } ! gatherTemplateParts( $templates )->join(); Async grabbing WordPress Templates in HackLang
  15. 15. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Key value stores Memcached and Redis (Redis Cloud)
  16. 16. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP id user_login user_pass user_nicename user_email … 1 tim diufhdiufg£bsdh874£423223 Tim tim@avvisi.co.uk … Traditional SQL DB
  17. 17. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Key : Value : Expiry (Optional) ! Tim : Geeky
  18. 18. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP WHAT ARE THEY GOOD FOR IN WORDPRESS? StoringreplicableData… Transients Caching JobQueuesbackends
  19. 19. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Memory comes and goes especially with age!
  20. 20. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Transients API Key : Value : Expiry (Optional)
  21. 21. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Using KSV to cache WordPress
  22. 22. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Rendering/ Template/Theme Processing/ Objects MySQL HTTP/ Other Services WordPress
  23. 23. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Page/Fragment Caching Object Caching Query Cache HTTP Caching Caching
  24. 24. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Caching can and will screw with you!
  25. 25. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Queue Management Beanstalkd & Gearman (Amazon SQS)
  26. 26. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk 1. WordPress sends job to queue 2. Job Server (Beanstalk, Gearman) Holds in a queue 3. Worker picks job from the queue and completes it 2. 3. 1. QUEUE MANAGEMENT SYSTEM
  27. 27. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk 1. User clicks approve on a comment, WordPress queries the database and collects all the emails to notify and the message to send and passes it to the job server. 
 2. Job Server put’s the emails into a queue
 3. Script calls the queue server and takes the email and message, emails the user and marks job complete, repeats until the queue is empty2. 3. 1. QUEUE MANAGEMENT SYSTEM (IN PRACTICE)
  28. 28. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP function gatherTemplateParts( $templates ){ $client = new GearmanClient(); $client->addServer(); $client->setCompleteCallback(function(GearmanTask $task, $context) use (&$return) { $return[] = $task->data(); }); ! foreach( $templates as $template ){ $client->addTask('getAsyncTemplatePart', $template ); } client->runTasks(); } ASYNC WITH GEARMAN - CLIENT
  29. 29. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP $worker = new GearmanWorker(); $worker->addServer(); $worker->addFunction('getAsyncTemplatePart', function(GearmanJob $job){ return get_template_part( key(), current() ); }); while ($worker->work()); ASYNC WITH GEARMAN - WORKER
  30. 30. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Caching reverse proxies Varnish (CloudFront, CloudFlare)
  31. 31. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP CLOUDFRONT NGINX (ORIGIN) NGINX Server
  32. 32. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP VARNISH NGINX (ORIGIN) PROXY CACHING OVER SSL WITH VARNISH NGINX SSL END POINT
  33. 33. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP Caching can and will screw with you!
  34. 34. COMPANY NAME PRESENTATION TITLE 12 - 12 - 2012 TimNash.co.uk @tnash #beyondLAMP TheEnd! Thanks for listening and don’t forget to visit... ! ! Slides: https://timnash.co.uk/mwug-may-2014

×