SlideShare a Scribd company logo
It’s all about eXperience
Gaetano Giunta
PHP London
July 2015
Making Symfony
Services async with
RabbitMq
(and more Symfony)
PechaKucha style!
A case study: generating M$Office docs
2
The needs
• Produce content in Microsoft Office formats
• Many formats for each document
• Both Word and Excel docs
• XML content generated by CMS
• LibreOffice used to generate MS Office and PDF
versions
• Has anyone tried generating OOXML by hand?
A case study: generating M$Office docs
3
Reality bites
• Slooow
• Rest assured that some of the docs will be pretty big
• Unreliable
• Depending on version, LO crashes from a-bit to almost-
always
• Race-prone
• Two conversion jobs in parallel might step on each other
A case study: generating M$Office docs
4
…and the results are:
• Ugly code: lots of polling, copying of files around,
manual locking
• Does not scale at all: only one conversion process
active at any given time
Web
server
PHP
Libre
Office
Waiting processes
TextBook scenario for introducing queues
5
Web
server
Worker
?
Rabbit
MQ
Libre
Office
PHP
TextBook scenario for introducing queues
6
Web
server
Worker
?
Rabbit
MQ
Libre
Office
PHP
TextBook scenario for introducing queues
7
Web
server
PHP
!
Rabbit
MQ
Libre
Office
PHP
TextBook scenario for introducing queues
8
Web
server
PHP
!
Rabbit
MQ
Libre
Office
PHP
TextBook scenario for introducing queues
9
Web
server
Symfony
!!!
Rabbit
MQ
Libre
Office
PHP
TextBook scenario for introducing queues
10
Web
server
Symfony
!!!
Rabbit
MQ
Libre
Office
PHP
The rationale
11
• Same library handling both sides of the connection
• Easier to troubleshoot
• Sf Console component is lovely
• Everything developed in a single repository
• No need to learn new languages
• Everything which I can rewrite in PHP, I eventually will*
* = 3rd whimsical law of Gaetano
The details
12
• Json used as payload encoding
• The worker has been made thread-safe
• Again, thanks to Symfony: the « Process » Component
• It spins up a new php process each time it receives a command
• The new process executes the command
• Bonus: a ‘watchdog’ to restart workers via crontab if they die
Symfony
listener
Symfony
listener
Symfony
listener
Symfony
worker
Libre
Office
Libre
Office
W
The evolution
13
• What is exactly a « queued command » ?
• For starters, each existing Symfony console command!
• Why not every existing Symfony Service?
• Allows to run existing services asynchronously
• As long as their arguments are serializable to json
• Not a project-specific tool any more
• Could be turned into a Bundle
• …
• Profit!
The problems
14
• Assumes good security on the network
• Low throughput
• Spinning up a new php worker process takes time
• Could we use php-fpm to communicate to workers
instead?
• Am I reinventing the wheel?
• Others?
• Suggestions are welcome
I’ll be here all night
15
THANK YOU
https://github.com/kaliop-uk/kueueingbundle
• @gggeek
• www.kaliop.co.uk
Ad

More Related Content

What's hot (20)

Auto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust LibrariesAuto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust Libraries
Steven McCown
 
EhTrace -- RoP Hooks
EhTrace -- RoP HooksEhTrace -- RoP Hooks
EhTrace -- RoP Hooks
Shane Macaulay
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
Tony Tam
 
What's the "right" PHP Framework?
What's the "right" PHP Framework?What's the "right" PHP Framework?
What's the "right" PHP Framework?
Barry Jones
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
Barry Jones
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
Modularity problems
Modularity  problemsModularity  problems
Modularity problems
Юлия Коваленко
 
Multi-platform Enterprise Messaging with RabbitMQ
Multi-platform Enterprise Messaging with RabbitMQMulti-platform Enterprise Messaging with RabbitMQ
Multi-platform Enterprise Messaging with RabbitMQ
Ortus Solutions, Corp
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
Wee Keat Chin
 
Perl-Critic
Perl-CriticPerl-Critic
Perl-Critic
Jonas Brømsø
 
How to Keep Your Data Safe in MongoDB
How to Keep Your Data Safe in MongoDBHow to Keep Your Data Safe in MongoDB
How to Keep Your Data Safe in MongoDB
MongoDB
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
Reuven Lerner
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
Paolo Negri
 
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San JoseTypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
Steve Reiner
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
nohuhu
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 
Redis
RedisRedis
Redis
Hung-yu Lin
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-on
APNIC
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
Jonas Brømsø
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
Tim Sommer
 
Auto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust LibrariesAuto-Generating Language-Specific Wrappers for Rust Libraries
Auto-Generating Language-Specific Wrappers for Rust Libraries
Steven McCown
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
Tony Tam
 
What's the "right" PHP Framework?
What's the "right" PHP Framework?What's the "right" PHP Framework?
What's the "right" PHP Framework?
Barry Jones
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
Barry Jones
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
Multi-platform Enterprise Messaging with RabbitMQ
Multi-platform Enterprise Messaging with RabbitMQMulti-platform Enterprise Messaging with RabbitMQ
Multi-platform Enterprise Messaging with RabbitMQ
Ortus Solutions, Corp
 
RabbitMQ fairly-indepth
RabbitMQ fairly-indepthRabbitMQ fairly-indepth
RabbitMQ fairly-indepth
Wee Keat Chin
 
How to Keep Your Data Safe in MongoDB
How to Keep Your Data Safe in MongoDBHow to Keep Your Data Safe in MongoDB
How to Keep Your Data Safe in MongoDB
MongoDB
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
Reuven Lerner
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
Paolo Negri
 
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San JoseTypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
TypeScript for Alfresco and CMIS - Alfresco DevCon 2012 San Jose
Steve Reiner
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
nohuhu
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009
Paolo Negri
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-on
APNIC
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
Tim Sommer
 

Similar to Making Symfony Services async with RabbitMq (and more Symfony) (20)

Symfony vs. Message Brokers
Symfony  vs.  Message BrokersSymfony  vs.  Message Brokers
Symfony vs. Message Brokers
Gaetano Giunta
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
Tomas Doran
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
Tomas Doran
 
Inner Symfony’s Daemons
 Inner Symfony’s Daemons Inner Symfony’s Daemons
Inner Symfony’s Daemons
Krzysztof (Chris) Ozog
 
Inner Symfony’s Daemons
Inner Symfony’s DaemonsInner Symfony’s Daemons
Inner Symfony’s Daemons
Codesushi.co (CODESUSHI LLC)
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
Elizabeth Smith
 
Message Queues & Offline Processing with PHP
Message Queues & Offline Processing with PHPMessage Queues & Offline Processing with PHP
Message Queues & Offline Processing with PHP
marcelesser
 
Improving the Pharo VM
Improving the Pharo VMImproving the Pharo VM
Improving the Pharo VM
FAST
 
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
Matthias Noback
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
Andrew McNicol
 
How Symfony Changed My Life
How Symfony Changed My LifeHow Symfony Changed My Life
How Symfony Changed My Life
Matthias Noback
 
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVMPerformance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Jani Tarvainen
 
Process Communication IPC in LINUX Environments
Process Communication IPC in LINUX EnvironmentsProcess Communication IPC in LINUX Environments
Process Communication IPC in LINUX Environments
infant2404
 
An Introduction to PyPy
An Introduction to PyPyAn Introduction to PyPy
An Introduction to PyPy
Michael Hudson-Doyle
 
Concurrency in ruby
Concurrency in rubyConcurrency in ruby
Concurrency in ruby
Marco Borromeo
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
Fabien Potencier
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
Steven Pousty
 
App::RemoteCommand
App::RemoteCommandApp::RemoteCommand
App::RemoteCommand
Shoichi Kaji
 
Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?
Docker, Inc.
 
Async programming in c#
Async programming in c#Async programming in c#
Async programming in c#
Ahasanul Kalam Akib
 
Symfony vs. Message Brokers
Symfony  vs.  Message BrokersSymfony  vs.  Message Brokers
Symfony vs. Message Brokers
Gaetano Giunta
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
Tomas Doran
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
Tomas Doran
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
Elizabeth Smith
 
Message Queues & Offline Processing with PHP
Message Queues & Offline Processing with PHPMessage Queues & Offline Processing with PHP
Message Queues & Offline Processing with PHP
marcelesser
 
Improving the Pharo VM
Improving the Pharo VMImproving the Pharo VM
Improving the Pharo VM
FAST
 
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)How Symfony changed my life (#SfPot, Paris, 19th November 2015)
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
Matthias Noback
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
Andrew McNicol
 
How Symfony Changed My Life
How Symfony Changed My LifeHow Symfony Changed My Life
How Symfony Changed My Life
Matthias Noback
 
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVMPerformance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Jani Tarvainen
 
Process Communication IPC in LINUX Environments
Process Communication IPC in LINUX EnvironmentsProcess Communication IPC in LINUX Environments
Process Communication IPC in LINUX Environments
infant2404
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
Steven Pousty
 
App::RemoteCommand
App::RemoteCommandApp::RemoteCommand
App::RemoteCommand
Shoichi Kaji
 
Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?Deploying PHP on PaaS: Why and How?
Deploying PHP on PaaS: Why and How?
Docker, Inc.
 
Ad

More from Gaetano Giunta (13)

php day 2008 - Introduzione agli ez components
php day 2008 - Introduzione agli ez componentsphp day 2008 - Introduzione agli ez components
php day 2008 - Introduzione agli ez components
Gaetano Giunta
 
phpday 2006 - SEA case study
phpday 2006 - SEA case studyphpday 2006 - SEA case study
phpday 2006 - SEA case study
Gaetano Giunta
 
phpday 2006 - WS in PHP
phpday 2006 - WS in PHPphpday 2006 - WS in PHP
phpday 2006 - WS in PHP
Gaetano Giunta
 
Powerful Automation Made Simple
Powerful Automation Made SimplePowerful Automation Made Simple
Powerful Automation Made Simple
Gaetano Giunta
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
Gaetano Giunta
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
Gaetano Giunta
 
Symfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case studySymfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case study
Gaetano Giunta
 
EzPerformancelogger & Graphite
EzPerformancelogger & GraphiteEzPerformancelogger & Graphite
EzPerformancelogger & Graphite
Gaetano Giunta
 
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Gaetano Giunta
 
eZPublish meets Simfony2 - phpDay2013
eZPublish meets Simfony2  - phpDay2013eZPublish meets Simfony2  - phpDay2013
eZPublish meets Simfony2 - phpDay2013
Gaetano Giunta
 
Ez performance measurement
Ez performance measurementEz performance measurement
Ez performance measurement
Gaetano Giunta
 
Ez Content Staging for the rest of us
Ez Content Staging for the rest of usEz Content Staging for the rest of us
Ez Content Staging for the rest of us
Gaetano Giunta
 
An eZ Publish Craftsman's toolchest
An eZ Publish Craftsman's toolchestAn eZ Publish Craftsman's toolchest
An eZ Publish Craftsman's toolchest
Gaetano Giunta
 
php day 2008 - Introduzione agli ez components
php day 2008 - Introduzione agli ez componentsphp day 2008 - Introduzione agli ez components
php day 2008 - Introduzione agli ez components
Gaetano Giunta
 
phpday 2006 - SEA case study
phpday 2006 - SEA case studyphpday 2006 - SEA case study
phpday 2006 - SEA case study
Gaetano Giunta
 
phpday 2006 - WS in PHP
phpday 2006 - WS in PHPphpday 2006 - WS in PHP
phpday 2006 - WS in PHP
Gaetano Giunta
 
Powerful Automation Made Simple
Powerful Automation Made SimplePowerful Automation Made Simple
Powerful Automation Made Simple
Gaetano Giunta
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
Gaetano Giunta
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
Gaetano Giunta
 
Symfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case studySymfony2 for legacy app rejuvenation: the eZ Publish case study
Symfony2 for legacy app rejuvenation: the eZ Publish case study
Gaetano Giunta
 
EzPerformancelogger & Graphite
EzPerformancelogger & GraphiteEzPerformancelogger & Graphite
EzPerformancelogger & Graphite
Gaetano Giunta
 
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Gaetano Giunta
 
eZPublish meets Simfony2 - phpDay2013
eZPublish meets Simfony2  - phpDay2013eZPublish meets Simfony2  - phpDay2013
eZPublish meets Simfony2 - phpDay2013
Gaetano Giunta
 
Ez performance measurement
Ez performance measurementEz performance measurement
Ez performance measurement
Gaetano Giunta
 
Ez Content Staging for the rest of us
Ez Content Staging for the rest of usEz Content Staging for the rest of us
Ez Content Staging for the rest of us
Gaetano Giunta
 
An eZ Publish Craftsman's toolchest
An eZ Publish Craftsman's toolchestAn eZ Publish Craftsman's toolchest
An eZ Publish Craftsman's toolchest
Gaetano Giunta
 
Ad

Recently uploaded (19)

IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 

Making Symfony Services async with RabbitMq (and more Symfony)

  • 1. It’s all about eXperience Gaetano Giunta PHP London July 2015 Making Symfony Services async with RabbitMq (and more Symfony) PechaKucha style!
  • 2. A case study: generating M$Office docs 2 The needs • Produce content in Microsoft Office formats • Many formats for each document • Both Word and Excel docs • XML content generated by CMS • LibreOffice used to generate MS Office and PDF versions • Has anyone tried generating OOXML by hand?
  • 3. A case study: generating M$Office docs 3 Reality bites • Slooow • Rest assured that some of the docs will be pretty big • Unreliable • Depending on version, LO crashes from a-bit to almost- always • Race-prone • Two conversion jobs in parallel might step on each other
  • 4. A case study: generating M$Office docs 4 …and the results are: • Ugly code: lots of polling, copying of files around, manual locking • Does not scale at all: only one conversion process active at any given time Web server PHP Libre Office Waiting processes
  • 5. TextBook scenario for introducing queues 5 Web server Worker ? Rabbit MQ Libre Office PHP
  • 6. TextBook scenario for introducing queues 6 Web server Worker ? Rabbit MQ Libre Office PHP
  • 7. TextBook scenario for introducing queues 7 Web server PHP ! Rabbit MQ Libre Office PHP
  • 8. TextBook scenario for introducing queues 8 Web server PHP ! Rabbit MQ Libre Office PHP
  • 9. TextBook scenario for introducing queues 9 Web server Symfony !!! Rabbit MQ Libre Office PHP
  • 10. TextBook scenario for introducing queues 10 Web server Symfony !!! Rabbit MQ Libre Office PHP
  • 11. The rationale 11 • Same library handling both sides of the connection • Easier to troubleshoot • Sf Console component is lovely • Everything developed in a single repository • No need to learn new languages • Everything which I can rewrite in PHP, I eventually will* * = 3rd whimsical law of Gaetano
  • 12. The details 12 • Json used as payload encoding • The worker has been made thread-safe • Again, thanks to Symfony: the « Process » Component • It spins up a new php process each time it receives a command • The new process executes the command • Bonus: a ‘watchdog’ to restart workers via crontab if they die Symfony listener Symfony listener Symfony listener Symfony worker Libre Office Libre Office W
  • 13. The evolution 13 • What is exactly a « queued command » ? • For starters, each existing Symfony console command! • Why not every existing Symfony Service? • Allows to run existing services asynchronously • As long as their arguments are serializable to json • Not a project-specific tool any more • Could be turned into a Bundle • … • Profit!
  • 14. The problems 14 • Assumes good security on the network • Low throughput • Spinning up a new php worker process takes time • Could we use php-fpm to communicate to workers instead? • Am I reinventing the wheel? • Others? • Suggestions are welcome
  • 15. I’ll be here all night 15 THANK YOU https://github.com/kaliop-uk/kueueingbundle • @gggeek • www.kaliop.co.uk