SlideShare a Scribd company logo
A Python Task Queue Story
Why and how we migrated from Celery to RQ
Paris.py #2
22-07-2013
Sylvain Zimmer
@sylvinus
Task Queue?
Offload long tasks to background workers
Pattern used by almost all big companies
PaaS support: Heroku, App Engine, ...
Major implementations:
Gearman (Perl)
Resque (Ruby)
Celery (Python)
[x.taskqueue for x in startups]
Jamendo (encoding MP3s, stats, emails, ...)
2005-2010: Custom Python+MySQL task queue
2010-present: Celery
Joshfire (building apps with Eclipse, Xcode, ...)
2011-present: Celery
Pricing Assistant (crawling, machine learning, ...)
2012-2013: Celery
Last month: Migrated to RQ!
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Celery design
Broker
RabbitMQ, Redis, MongoDB, ...
Result backend
SQL, Redis, MongoDB, ...
Frontends Workers
Queue tasks
Get status/results
Poll or receive tasks
Store results
Celery: the good
Easy start
It’s FAST
Low latency thanks to RabbitMQ
High throughput thanks to pre-fetching tasks
“Millions of tasks per minute per process”
Countless features
Monitoring
Workflows (grouping, chaining, ...)
Time & rate limits
Scheduling
Autoscaling
Autoreloading
Customizable down to the core components
Other perks
Well tested
Pretty good documentation
Main developer (@ask) is quite helpful
Being the reference Python implementation
Celery: the bad
Work of one man
Complicated
REALLY Complicated
Complex
(after deleting tests)
(celery itself = 15,473)
/! Lines of code aren’t a perfect metric
REALLY Complex
$ sfood celery | sfood-graph | dot -Tpdf
The ugly?
There is no ugly.
Be grateful for the open source software you use!
Understand software before making a choice and blame
yourself if you made the wrong one, not the authors!
Our paradoxical choice
We needed more from our task queue
We needed to understand 100% of how it works
We didn’t need layers of abstraction for everything.
Just one implementation that worked!
- = +
RQ
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Quick comparison
Celery RQ
Broker
Concurrency
Lines of code
Scheduler
Routing
RabbitMQ, Redis, MongoDB, ... Redis
Master-slave processes supervisord + fork()
~27k ~2k
Built-in 3rd-party
Advanced exchanges List of queues
SIMPLE
3 main classes: Job, Queue, Worker
Queue.enqueue_call() :
Still not perfect!
Creator @nvie also the only primary author
Much less mature (0.3.8) than Celery (3.0.21)
Can’t serialize task results to JSON (only pickle)
Limited concurrency model (for now)
Monitoring tools can be improved
Our migration
Surprisingly easy
We didn’t use much of the advanced Celery features
Just changed task parent class + send_task()
Joy of understanding 100% of your app’s code ;)
Discovered some long-standing errors in our tasks
Only real step back was the monitoring frontend
Monitoring
Monitoring improvements
https://github.com/pricingassistant/rq-dashboard
We’re hiring Python hackers!
sylvain@pricingassistant.com
Thanks!
Questions?
sylvain@pricingassistant.com

More Related Content

What's hot (20)

PPTX
Surah Al-Falaq
BananMahmaljyObeid
 
PDF
HIJAB - Complete protection for women
Caller To Islam / الداعية الإسلامي
 
PDF
Bibliography & Modals; English Powerpoint
Jennelyn Clarito
 
PPT
Aisha bint abu bakr (5)
Khalid Abdullah
 
PDF
Surah humuzah
Mohammad Yunus, MD, FACP
 
PPS
Prophet Yusuf (a.s.)
ftjaffer
 
PPS
Prophet Musa, Part 1 of 6
MuQeet
 
DOCX
Human resource manager performance appraisal
evansaaron775
 
PPTX
The Life of the Prophet Muhammad: Chapter 12: Summary
Adil Hussain
 
DOC
Performance Review Template
Demand Metric
 
PPT
(Slideshare) lesson# 13-tauhid-sifat -(the 20 attributes) 7-july-2012.pot
Zhulkeflee Ismail
 
PPTX
Salah For Beginners
Fanar
 
PPT
Copy-editing NewSymbols and AP Style.ppt
RomuloReas
 
PDF
What Muslim Children Must Know
Islamhouse.com
 
PPTX
105. Surah Al-Fil
Hira Sohaib
 
PPTX
Prophets of islam
AYSHA NADA
 
PPTX
Sl7.1 Seerah of the Prophet Muhammed (sws)
Ayah Moonfruit
 
DOC
Mcdonalds team leader performance appraisal
smalldonan
 
PPTX
DISIPLIN KEILMUANDALAM ISLAM
Ahmad Khaidir Ali Fullah
 
PDF
Method of Wudhu, Ghusal & Salaah (Shafi')
Caller To Islam / الداعية الإسلامي
 
Surah Al-Falaq
BananMahmaljyObeid
 
HIJAB - Complete protection for women
Caller To Islam / الداعية الإسلامي
 
Bibliography & Modals; English Powerpoint
Jennelyn Clarito
 
Aisha bint abu bakr (5)
Khalid Abdullah
 
Prophet Yusuf (a.s.)
ftjaffer
 
Prophet Musa, Part 1 of 6
MuQeet
 
Human resource manager performance appraisal
evansaaron775
 
The Life of the Prophet Muhammad: Chapter 12: Summary
Adil Hussain
 
Performance Review Template
Demand Metric
 
(Slideshare) lesson# 13-tauhid-sifat -(the 20 attributes) 7-july-2012.pot
Zhulkeflee Ismail
 
Salah For Beginners
Fanar
 
Copy-editing NewSymbols and AP Style.ppt
RomuloReas
 
What Muslim Children Must Know
Islamhouse.com
 
105. Surah Al-Fil
Hira Sohaib
 
Prophets of islam
AYSHA NADA
 
Sl7.1 Seerah of the Prophet Muhammed (sws)
Ayah Moonfruit
 
Mcdonalds team leader performance appraisal
smalldonan
 
DISIPLIN KEILMUANDALAM ISLAM
Ahmad Khaidir Ali Fullah
 
Method of Wudhu, Ghusal & Salaah (Shafi')
Caller To Islam / الداعية الإسلامي
 

Similar to Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2 (20)

PDF
What DevOps Isn't
Frank Lamantia
 
PDF
Distributed Deep Learning with Docker at Salesforce
Docker, Inc.
 
PDF
Ray and Its Growing Ecosystem
Databricks
 
PDF
Scaling Engineering with Docker
Tom Leach
 
DOCX
MY NEWEST RESUME
Han Yan
 
DOCX
MY NEWEST RESUME
Han Yan
 
PPTX
From Zero to Lots - ScaleCamp UK 2009
Josh Devins
 
PPTX
Developing Actors in Azure with .net
Marco Parenzan
 
DOC
Resume
Gurpreet Singh
 
PDF
DevOps
Bardia Heydari
 
PPT
Scaling Ruby for Enterprise Applications
Pro777
 
PDF
Super Sizing Youtube with Python
didip
 
PDF
Os Solomon
oscon2007
 
DOCX
MY NEWEST RESUME
Han Yan
 
PDF
The "Holy Grail" of Dev/Ops
Erik Osterman
 
PDF
DevOps at Obama for America(2012) and the DNC (DevOps Days NYC Jan 2013)
John Schneider
 
PPTX
Golang
Fatih Şimşek
 
PPTX
What`s New in Java 8
Mohsen Zainalpour
 
PDF
The Business Value of PaaS Automation - Kieron Sambrook-Smith - Presentation ...
eZ Systems
 
What DevOps Isn't
Frank Lamantia
 
Distributed Deep Learning with Docker at Salesforce
Docker, Inc.
 
Ray and Its Growing Ecosystem
Databricks
 
Scaling Engineering with Docker
Tom Leach
 
MY NEWEST RESUME
Han Yan
 
MY NEWEST RESUME
Han Yan
 
From Zero to Lots - ScaleCamp UK 2009
Josh Devins
 
Developing Actors in Azure with .net
Marco Parenzan
 
Scaling Ruby for Enterprise Applications
Pro777
 
Super Sizing Youtube with Python
didip
 
Os Solomon
oscon2007
 
MY NEWEST RESUME
Han Yan
 
The "Holy Grail" of Dev/Ops
Erik Osterman
 
DevOps at Obama for America(2012) and the DNC (DevOps Days NYC Jan 2013)
John Schneider
 
What`s New in Java 8
Mohsen Zainalpour
 
The Business Value of PaaS Automation - Kieron Sambrook-Smith - Presentation ...
eZ Systems
 
Ad

More from Sylvain Zimmer (13)

PDF
Developer-friendly taskqueues: What you should ask yourself before choosing one
Sylvain Zimmer
 
PDF
Ranking the Web with Spark
Sylvain Zimmer
 
PDF
The original vision of Nutch, 14 years later: Building an open source search ...
Sylvain Zimmer
 
PDF
PyCon FR 2016 - Et si on recodait Google en Python ?
Sylvain Zimmer
 
PDF
[fr] Introduction et Live-code Backbone.js à DevoxxFR 2013
Sylvain Zimmer
 
PDF
140byt.es - The Dark Side of Javascript
Sylvain Zimmer
 
PDF
Joshfire Framework 0.9 Technical Overview
Sylvain Zimmer
 
PDF
Javascript Views, Client-side or Server-side with NodeJS
Sylvain Zimmer
 
PDF
no.de quick presentation at #ParisJS 4
Sylvain Zimmer
 
PDF
Kinect + Javascript tech talk at #ParisJS Jan 2011
Sylvain Zimmer
 
PDF
Web Crawling with NodeJS
Sylvain Zimmer
 
PDF
Archicamp présentation
Sylvain Zimmer
 
PDF
Twisted presentation & Jamendo usecases
Sylvain Zimmer
 
Developer-friendly taskqueues: What you should ask yourself before choosing one
Sylvain Zimmer
 
Ranking the Web with Spark
Sylvain Zimmer
 
The original vision of Nutch, 14 years later: Building an open source search ...
Sylvain Zimmer
 
PyCon FR 2016 - Et si on recodait Google en Python ?
Sylvain Zimmer
 
[fr] Introduction et Live-code Backbone.js à DevoxxFR 2013
Sylvain Zimmer
 
140byt.es - The Dark Side of Javascript
Sylvain Zimmer
 
Joshfire Framework 0.9 Technical Overview
Sylvain Zimmer
 
Javascript Views, Client-side or Server-side with NodeJS
Sylvain Zimmer
 
no.de quick presentation at #ParisJS 4
Sylvain Zimmer
 
Kinect + Javascript tech talk at #ParisJS Jan 2011
Sylvain Zimmer
 
Web Crawling with NodeJS
Sylvain Zimmer
 
Archicamp présentation
Sylvain Zimmer
 
Twisted presentation & Jamendo usecases
Sylvain Zimmer
 
Ad

Recently uploaded (20)

PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Kubernetes - Architecture & Components.pdf
geethak285
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
WSO2
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 

Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2