2. What is it all about?
PHP
Gearman
Supervisor
Job Management
3. Let’s get REAL!
Deploy Ninja – A case study
PROPOSED FEATURES
Deployment Solution (SVN to s/FTP)
Trigger URL – Web Hooks
Deploy Now – Deploy the latest right now
Full Deploy – Upload the entire repo again
4. How to train our Ninja?
What did we have to do?
REQUIREMENTS
Tasks Involved:
Fetch the repo
Upload to the server
Instant processing
Process separation for the three deployment
types
5. And cometh the tragedy!
The day my life sucked !^@#
ARCHITECTURAL CHALLENGES
Instant processing requires “Daemons”
PHP was not built for long running processes!
Premature termination & Zombie processes.
Monitoring the processes.
Restarting the processes when terminated.
6. Gearman, the super hero!
He came and saved my a$$
GEARMAN FEATURES
Distributed workload management
Client – Worker Architecture
Multiple workers
Multi-lingual workers
14. Gearman: Alternatives!
Who else is there?
RabbitMQ
ZeroMQ
Apache MQ
Dropr
Microsoft MQ
15. Whew! Almost done!
Life is getting better
CHALLENGES STATUS
Instant processing requires “Daemons”
PHP was not built for long running processes!
Premature termination & Zombie processes.
Monitoring the processes.
Restarting the processes when terminated.
16. Meet Supervisor!
Here comes the tough guy!
SUPERVISOR FEATURES
Simple & Centralized
Efficient & Extensible
Compatible & Proven
It monitors your processes and restarts as
instructed!
18. Supervisor: Getting Started!
Config, debug and run! QR Code
sudo echo_supervisord_conf >
/etc/supervisord.conf
sudo supervisord -n
sudo supervisord
19. Hurray! We’re done!
Life is so good :D
CHALLENGES STATUS
Instant processing requires “Daemons”
PHP was not built for long running processes!
Premature termination & Zombie processes.
Monitoring the processes.
Restarting the processes when terminated.
20. What’s your Story?
You can do it too!
USE CASES
Image Processing?
Cache Regeneration?
Mass emails?