SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
Faster Response Times
By using the Starling Queue Server




               Erik Osterman
               Launch 10 Labs LLC
               http://launch10.com
What is the problem?

● You want to write a lot of data quickly
   ○ e.g. tons of INSERTs & UPDATEs
   ○ Bursts exceed capacity
   ○ No ability to throttle requests
● Requests that modify stored data are slow / timeout
   ○ Reduced page impressions
   ○ Reduced revenues (CPM)
   ○ Customers bail
   ○ You look bad!
● Added Memcache, but it's still slow (duh?)!
   ○ Memcache only speeds up reads, not writes
What is the solution?

● Don't write to the database!
● Create jobs in the queue instead of writes to the DB
● Writing objects to queue is FAST
● Use a multi-threaded batch processor to run the jobs
  "As fast as you can"
● Jargon (queue, job, batch processor)
Why use Starling?

● Used in massive production environments
● Lightweight, Extremely FAST
● Persistent (crash recoverable)
● Trivial to scale; scales just like memcached
● Handles hundreds of thousands of items
● Thousands of queue inserts per second
● Speaks Memcache protocol (very simple! very portable!)
● Minimal code changes*
● Named Queues
● Performance metrics / stats
● GNU LGPL License (= Free software!)
● (Not Java)
Everyone's doing it.....

● The Dot Game & Paradigm (starling)
● Twitter (starling)
● Friends For Sale (starling)
● FiveRuns (starling)
● Causes on Facebook (beanstalkd)
● ShareThis (SQS)
● Alexa (SQS)
● Insert your company here

                 Maybe you should too!
What do I need to use Starling?

Not much!
 ● Server with Ruby to run Starling
 ● # gem install starling
 ● Memcache Client
 ● Configure application to add jobs to the queue
 ● Batch process to run the jobs in the queue
PHP Example (request)

// index.php
<?php
$memcache = new Memcache();
$memcache->addServer('localhost', 22122);
$memcache->set('last_seen', Array('user_id'
=>                                  $_SESSION['user_id'],
'timestamp' => time()));
?>
PHP Example (batch)
<?php
// process-jobs.php
$memcache = new Memcache();
$memcache->addServer('localhost', 22122);
while(true)
{
   if($job = $memcache->get('last_seen'))
   {
      // Process $job
   } else {
      // Queue empty!
      sleep(1);
   }
}
?>
What are my alternatives?

● Increase I/O capacity (expensive!)
● Use a faster DB solution
● Shard your database (hard!)
● Master-master replication (tricky!)
● Memcache (Wrong answer! not applicable)
● Use a simple queue table (slow!)
● Optimize tables / reduce FKs & indexes / change engine
● Write less

     Best solution? As many optimizations as you can.
Other Queue Servers
 ● Starling (LGPL)
 ● BeanStalk (GNU GPL v3)
 ● Open Message Queue(CDDL / GPL v2)
 ● Apache Active MQ (Apache 2.0 License)
 ● Rabbit MQ (Mozilla Public License)
 ● Sparrow (MIT License)
 ● Scarling (ISC license)
 ● MySQL Home brewed solution

Not so free
 ● Amazon SQS (Pay per Query)
 ● Microsoft Message Queue Server
 ● IBM WebSphere MQ
Q&A


   What did I miss?



tinyurl.com/L10-starling

             Erik Osterman
          www.launch10.com
   eosterman@launch10.com

Más contenido relacionado

La actualidad más candente

Mailerqnewpresentation
MailerqnewpresentationMailerqnewpresentation
Mailerqnewpresentation
Copernica BV
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
Lee Boynton
 
CPAN Gems From The Far East
CPAN Gems From The Far EastCPAN Gems From The Far East
CPAN Gems From The Far East
lestrrat
 
Scale like a pro with Gearman
Scale like a pro with GearmanScale like a pro with Gearman
Scale like a pro with Gearman
Amal Raghav
 

La actualidad más candente (16)

Big Data in Action
Big Data in ActionBig Data in Action
Big Data in Action
 
Async ... Await – concurrency in java script
Async ... Await – concurrency in java scriptAsync ... Await – concurrency in java script
Async ... Await – concurrency in java script
 
Running Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic BeanstalkRunning Containerized Node.js Services on AWS Elastic Beanstalk
Running Containerized Node.js Services on AWS Elastic Beanstalk
 
PHP and node.js Together
PHP and node.js TogetherPHP and node.js Together
PHP and node.js Together
 
Mailerqnewpresentation
MailerqnewpresentationMailerqnewpresentation
Mailerqnewpresentation
 
Integrating Node.js with PHP
Integrating Node.js with PHPIntegrating Node.js with PHP
Integrating Node.js with PHP
 
Shootout at the AWS Corral
Shootout at the AWS CorralShootout at the AWS Corral
Shootout at the AWS Corral
 
Solving some of the scalability problems at booking.com
Solving some of the scalability problems at booking.comSolving some of the scalability problems at booking.com
Solving some of the scalability problems at booking.com
 
Enterprise messaging
Enterprise messagingEnterprise messaging
Enterprise messaging
 
CPAN Gems From The Far East
CPAN Gems From The Far EastCPAN Gems From The Far East
CPAN Gems From The Far East
 
Islamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningIslamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuning
 
Welcome to NPM search 2.0
Welcome to NPM search 2.0Welcome to NPM search 2.0
Welcome to NPM search 2.0
 
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
Introducing TokuMX: The Performance Engine for MongoDB (NYC.rb 2013-12-10)
 
Scale like a pro with Gearman
Scale like a pro with GearmanScale like a pro with Gearman
Scale like a pro with Gearman
 
Using Ceph in OStack.de - Ceph Day Frankfurt
Using Ceph in OStack.de - Ceph Day Frankfurt Using Ceph in OStack.de - Ceph Day Frankfurt
Using Ceph in OStack.de - Ceph Day Frankfurt
 
Node js
Node jsNode js
Node js
 

Destacado

RightScale User Conference: Why RightScale?
RightScale User Conference: Why RightScale?RightScale User Conference: Why RightScale?
RightScale User Conference: Why RightScale?
Erik Osterman
 
Speeding up Page Load Times by Using the Starling Queue Server
Speeding up Page Load Times by Using the Starling Queue ServerSpeeding up Page Load Times by Using the Starling Queue Server
Speeding up Page Load Times by Using the Starling Queue Server
Erik Osterman
 
Catálogo CaldeHurta
Catálogo CaldeHurtaCatálogo CaldeHurta
Catálogo CaldeHurta
iyancalde
 
Automatic selection of object recognition methods using reinforcement learning
Automatic selection of object recognition methods using reinforcement learningAutomatic selection of object recognition methods using reinforcement learning
Automatic selection of object recognition methods using reinforcement learning
Shunta Saito
 
視覚認知システムにおける知覚と推論
視覚認知システムにおける知覚と推論視覚認知システムにおける知覚と推論
視覚認知システムにおける知覚と推論
Shunta Saito
 
強化学習入門
強化学習入門強化学習入門
強化学習入門
Shunta Saito
 

Destacado (20)

Docker Demystified for SB JUG
Docker Demystified for SB JUGDocker Demystified for SB JUG
Docker Demystified for SB JUG
 
RightScale User Conference: Why RightScale?
RightScale User Conference: Why RightScale?RightScale User Conference: Why RightScale?
RightScale User Conference: Why RightScale?
 
Speeding up Page Load Times by Using the Starling Queue Server
Speeding up Page Load Times by Using the Starling Queue ServerSpeeding up Page Load Times by Using the Starling Queue Server
Speeding up Page Load Times by Using the Starling Queue Server
 
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
 
Docker Demystified - Virtual VMs without the Fat
Docker Demystified - Virtual VMs without the FatDocker Demystified - Virtual VMs without the Fat
Docker Demystified - Virtual VMs without the Fat
 
Catálogo CaldeHurta
Catálogo CaldeHurtaCatálogo CaldeHurta
Catálogo CaldeHurta
 
What skills do you need to be an effective Electronic Resources Librarian?
What skills do you need to be an effective Electronic Resources Librarian?What skills do you need to be an effective Electronic Resources Librarian?
What skills do you need to be an effective Electronic Resources Librarian?
 
Ppt221209 100425094924 Phpapp02
Ppt221209 100425094924 Phpapp02Ppt221209 100425094924 Phpapp02
Ppt221209 100425094924 Phpapp02
 
集合知プログラミングゼミ第1回
集合知プログラミングゼミ第1回集合知プログラミングゼミ第1回
集合知プログラミングゼミ第1回
 
Automatic selection of object recognition methods using reinforcement learning
Automatic selection of object recognition methods using reinforcement learningAutomatic selection of object recognition methods using reinforcement learning
Automatic selection of object recognition methods using reinforcement learning
 
Building detection with decision fusion
Building detection with decision fusionBuilding detection with decision fusion
Building detection with decision fusion
 
Peperiksaan penggal 1 sejarah thn 5 (sk2sg)
Peperiksaan penggal 1 sejarah thn 5 (sk2sg)Peperiksaan penggal 1 sejarah thn 5 (sk2sg)
Peperiksaan penggal 1 sejarah thn 5 (sk2sg)
 
Building and road detection from large aerial imagery
Building and road detection from large aerial imageryBuilding and road detection from large aerial imagery
Building and road detection from large aerial imagery
 
視覚認知システムにおける知覚と推論
視覚認知システムにおける知覚と推論視覚認知システムにおける知覚と推論
視覚認知システムにおける知覚と推論
 
DeepPose: Human Pose Estimation via Deep Neural Networks
DeepPose: Human Pose Estimation via Deep Neural NetworksDeepPose: Human Pose Estimation via Deep Neural Networks
DeepPose: Human Pose Estimation via Deep Neural Networks
 
強化学習入門
強化学習入門強化学習入門
強化学習入門
 
LT@Chainer Meetup
LT@Chainer MeetupLT@Chainer Meetup
LT@Chainer Meetup
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 

Similar a Speeding up Page Load Times by Using Starling

kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
What SQL should actually be...
What SQL should actually be...What SQL should actually be...
What SQL should actually be...
Open Academy
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Per Henrik Lausten
 
Scala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache sparkScala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache spark
Demi Ben-Ari
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemaker
kuchinskaya
 

Similar a Speeding up Page Load Times by Using Starling (20)

kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Plpgsql russia-pgconf
Plpgsql russia-pgconfPlpgsql russia-pgconf
Plpgsql russia-pgconf
 
Utopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K usersUtopia Kindgoms scaling case: From 4 to 50K users
Utopia Kindgoms scaling case: From 4 to 50K users
 
Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+Utopia Kingdoms scaling case. From 4 users to 50.000+
Utopia Kingdoms scaling case. From 4 users to 50.000+
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance Computing
 
What SQL should actually be...
What SQL should actually be...What SQL should actually be...
What SQL should actually be...
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)
 
Scala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache sparkScala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache spark
 
Java vs. C/C++
Java vs. C/C++Java vs. C/C++
Java vs. C/C++
 
Streaming huge databases using logical decoding
Streaming huge databases using logical decodingStreaming huge databases using logical decoding
Streaming huge databases using logical decoding
 
Mongodb meetup
Mongodb meetupMongodb meetup
Mongodb meetup
 
Scaling tokopedia-past-present-future
Scaling tokopedia-past-present-futureScaling tokopedia-past-present-future
Scaling tokopedia-past-present-future
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemaker
 
A first look into the Project Loom in Java
A first look into the Project Loom in JavaA first look into the Project Loom in Java
A first look into the Project Loom in Java
 
Redis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs TalksRedis Developers Day 2014 - Redis Labs Talks
Redis Developers Day 2014 - Redis Labs Talks
 
Real-world Experiences in Scala
Real-world Experiences in ScalaReal-world Experiences in Scala
Real-world Experiences in Scala
 
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Speeding up Page Load Times by Using Starling

  • 1. Faster Response Times By using the Starling Queue Server Erik Osterman Launch 10 Labs LLC http://launch10.com
  • 2. What is the problem? ● You want to write a lot of data quickly ○ e.g. tons of INSERTs & UPDATEs ○ Bursts exceed capacity ○ No ability to throttle requests ● Requests that modify stored data are slow / timeout ○ Reduced page impressions ○ Reduced revenues (CPM) ○ Customers bail ○ You look bad! ● Added Memcache, but it's still slow (duh?)! ○ Memcache only speeds up reads, not writes
  • 3. What is the solution? ● Don't write to the database! ● Create jobs in the queue instead of writes to the DB ● Writing objects to queue is FAST ● Use a multi-threaded batch processor to run the jobs "As fast as you can" ● Jargon (queue, job, batch processor)
  • 4. Why use Starling? ● Used in massive production environments ● Lightweight, Extremely FAST ● Persistent (crash recoverable) ● Trivial to scale; scales just like memcached ● Handles hundreds of thousands of items ● Thousands of queue inserts per second ● Speaks Memcache protocol (very simple! very portable!) ● Minimal code changes* ● Named Queues ● Performance metrics / stats ● GNU LGPL License (= Free software!) ● (Not Java)
  • 5. Everyone's doing it..... ● The Dot Game & Paradigm (starling) ● Twitter (starling) ● Friends For Sale (starling) ● FiveRuns (starling) ● Causes on Facebook (beanstalkd) ● ShareThis (SQS) ● Alexa (SQS) ● Insert your company here Maybe you should too!
  • 6. What do I need to use Starling? Not much! ● Server with Ruby to run Starling ● # gem install starling ● Memcache Client ● Configure application to add jobs to the queue ● Batch process to run the jobs in the queue
  • 7. PHP Example (request) // index.php <?php $memcache = new Memcache(); $memcache->addServer('localhost', 22122); $memcache->set('last_seen', Array('user_id' => $_SESSION['user_id'], 'timestamp' => time())); ?>
  • 8. PHP Example (batch) <?php // process-jobs.php $memcache = new Memcache(); $memcache->addServer('localhost', 22122); while(true) { if($job = $memcache->get('last_seen')) { // Process $job } else { // Queue empty! sleep(1); } } ?>
  • 9. What are my alternatives? ● Increase I/O capacity (expensive!) ● Use a faster DB solution ● Shard your database (hard!) ● Master-master replication (tricky!) ● Memcache (Wrong answer! not applicable) ● Use a simple queue table (slow!) ● Optimize tables / reduce FKs & indexes / change engine ● Write less Best solution? As many optimizations as you can.
  • 10. Other Queue Servers ● Starling (LGPL) ● BeanStalk (GNU GPL v3) ● Open Message Queue(CDDL / GPL v2) ● Apache Active MQ (Apache 2.0 License) ● Rabbit MQ (Mozilla Public License) ● Sparrow (MIT License) ● Scarling (ISC license) ● MySQL Home brewed solution Not so free ● Amazon SQS (Pay per Query) ● Microsoft Message Queue Server ● IBM WebSphere MQ
  • 11. Q&A What did I miss? tinyurl.com/L10-starling Erik Osterman www.launch10.com eosterman@launch10.com