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
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