SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Supervisor, Gearman and PHP - Job
management with sanity!

    ABU ASHRAF MASNUN
What is it all about?

 PHP
 Gearman
Supervisor
 Job Management
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
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
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.
Gearman, the super hero!
            He came and saved my a$$ 

            GEARMAN FEATURES
 Distributed workload management
 Client – Worker Architecture
 Multiple workers
 Multi-lingual workers
Gearman: How it works?
   Understanding Gearman
Gearman: Installation
                             Are you ready?   QR Code



Install Gearman:
          sudo apt-get install gearman
Install Libgearman:
    sudo apt-get install libgearman-dev
Install the PHP Extension:
                sudo pecl install
       channel://pecl.php.net/gearman-0.8.0
Gearman: Daemonizing!
                      Starting Gearman     QR Code




Running Gearman
Daemon:      sudo gearman –d –u root


Debugging Gearman (Verbose mode) :
            sudo gearman –d -vvv –u root
QR Code
Gearman: Workers
     PHP Worker
QR Code
Gearman: Workers
   Breaking it down!
QR Code
Gearman: Workers
   Breaking it down!
QR Code
Gearman: Clients
   Requesting a job!
Gearman: Alternatives!
       Who else is there?


 RabbitMQ
 ZeroMQ
 Apache MQ
 Dropr
 Microsoft MQ
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.
Meet Supervisor!
               Here comes the tough guy!

             SUPERVISOR FEATURES
 Simple & Centralized
 Efficient & Extensible
 Compatible & Proven

It monitors your processes and restarts as
instructed!
Supervisor: Installation!
                  Let’s go!         QR Code




sudo apt-get install python-setuptools

     sudo easy_install supervisor
Supervisor: Getting Started!
     Config, debug and run!    QR Code




sudo echo_supervisord_conf >
    /etc/supervisord.conf

    sudo supervisord -n

      sudo supervisord
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.
What’s your Story?
                 You can do it too!

                USE CASES
 Image Processing?
 Cache Regeneration?
 Mass emails?
That was Simple! Eh?
    Got anything to ask?
The Leevian!
           Who am I?



     ABU ASHRAF MASNUN

  Software Engineer @ Leevio
http://masnun.com
masnun@leevio.com

Weitere ähnliche Inhalte

Was ist angesagt?

Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniterErik Giberti
 
Distributed Applications with Perl & Gearman
Distributed Applications with Perl & GearmanDistributed Applications with Perl & Gearman
Distributed Applications with Perl & GearmanIssac Goldstand
 
Faster PHP apps using Queues and Workers
Faster PHP apps using Queues and WorkersFaster PHP apps using Queues and Workers
Faster PHP apps using Queues and WorkersRichard Baker
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by stepDaniel Fahlke
 
Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)benbrowning
 
The Mysteries Of JavaScript-Fu (RailsConf Ediition)
The Mysteries Of JavaScript-Fu (RailsConf Ediition)The Mysteries Of JavaScript-Fu (RailsConf Ediition)
The Mysteries Of JavaScript-Fu (RailsConf Ediition)danwrong
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)Stefan Koopmanschap
 
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016Codemotion
 
Magnolia Conference Basel 2016 SysEleven
Magnolia Conference Basel 2016 SysElevenMagnolia Conference Basel 2016 SysEleven
Magnolia Conference Basel 2016 SysElevenSimon Pearce
 
Background processes and tasks in an async world
Background processes and tasks in an async worldBackground processes and tasks in an async world
Background processes and tasks in an async worldparticlebanana
 
JRuby - Everything in a single process
JRuby - Everything in a single processJRuby - Everything in a single process
JRuby - Everything in a single processocher
 
Using the Command Line: Bash and WP-CLI
Using the Command Line: Bash and WP-CLIUsing the Command Line: Bash and WP-CLI
Using the Command Line: Bash and WP-CLIMarc Gratch
 
Ruby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay ShanghaiRuby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay ShanghaiJackson Tian
 
Ruby meetup 7_years_in_testing
Ruby meetup 7_years_in_testingRuby meetup 7_years_in_testing
Ruby meetup 7_years_in_testingDigital Natives
 
20110701 zsc2011-advanced proxying-formatted
20110701 zsc2011-advanced proxying-formatted20110701 zsc2011-advanced proxying-formatted
20110701 zsc2011-advanced proxying-formattedZarafa
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for PerlPerrin Harkins
 
Essential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksEssential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksKaloyan Raev
 

Was ist angesagt? (20)

Gearman and CodeIgniter
Gearman and CodeIgniterGearman and CodeIgniter
Gearman and CodeIgniter
 
Distributed Applications with Perl & Gearman
Distributed Applications with Perl & GearmanDistributed Applications with Perl & Gearman
Distributed Applications with Perl & Gearman
 
Faster PHP apps using Queues and Workers
Faster PHP apps using Queues and WorkersFaster PHP apps using Queues and Workers
Faster PHP apps using Queues and Workers
 
Improve the deployment process step by step
Improve the deployment process step by stepImprove the deployment process step by step
Improve the deployment process step by step
 
Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)Why I Love TorqueBox (And Why You Will Too)
Why I Love TorqueBox (And Why You Will Too)
 
The Mysteries Of JavaScript-Fu (RailsConf Ediition)
The Mysteries Of JavaScript-Fu (RailsConf Ediition)The Mysteries Of JavaScript-Fu (RailsConf Ediition)
The Mysteries Of JavaScript-Fu (RailsConf Ediition)
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)
 
The Power of Refactoring
The Power of RefactoringThe Power of Refactoring
The Power of Refactoring
 
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
Deploying node.js at scale - Maraschi, Collina - Codemotion Amsterdam 2016
 
Magnolia Conference Basel 2016 SysEleven
Magnolia Conference Basel 2016 SysElevenMagnolia Conference Basel 2016 SysEleven
Magnolia Conference Basel 2016 SysEleven
 
Rubyhosting
RubyhostingRubyhosting
Rubyhosting
 
Background processes and tasks in an async world
Background processes and tasks in an async worldBackground processes and tasks in an async world
Background processes and tasks in an async world
 
JRuby - Everything in a single process
JRuby - Everything in a single processJRuby - Everything in a single process
JRuby - Everything in a single process
 
Using the Command Line: Bash and WP-CLI
Using the Command Line: Bash and WP-CLIUsing the Command Line: Bash and WP-CLI
Using the Command Line: Bash and WP-CLI
 
Grape golilath
Grape golilathGrape golilath
Grape golilath
 
Ruby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay ShanghaiRuby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay Shanghai
 
Ruby meetup 7_years_in_testing
Ruby meetup 7_years_in_testingRuby meetup 7_years_in_testing
Ruby meetup 7_years_in_testing
 
20110701 zsc2011-advanced proxying-formatted
20110701 zsc2011-advanced proxying-formatted20110701 zsc2011-advanced proxying-formatted
20110701 zsc2011-advanced proxying-formatted
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for Perl
 
Essential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricksEssential debugging php debugging techniques, tips & tricks
Essential debugging php debugging techniques, tips & tricks
 

Andere mochten auch

In the Back of Your Mind
In the Back of Your MindIn the Back of Your Mind
In the Back of Your MindJames Gray
 
Asynchronous Awesome
Asynchronous AwesomeAsynchronous Awesome
Asynchronous AwesomeFlip Sasser
 
Open Source 2.0
Open Source 2.0Open Source 2.0
Open Source 2.0samof76
 
Tối ưu hóa việc ghi dữ liệu với Gearman
Tối ưu hóa việc ghi dữ liệu với GearmanTối ưu hóa việc ghi dữ liệu với Gearman
Tối ưu hóa việc ghi dữ liệu với GearmanMinh Nguyen Vo Cao
 
Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)
Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)
Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)James Titcumb
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + MemcachedFord AntiTrust
 
1秒間に250通のメールをさばくAWSの使い方
1秒間に250通のメールをさばくAWSの使い方1秒間に250通のメールをさばくAWSの使い方
1秒間に250通のメールをさばくAWSの使い方Tokyo Otaku Mode Inc.
 
AWSが誕生するまでの秘話
AWSが誕生するまでの秘話AWSが誕生するまでの秘話
AWSが誕生するまでの秘話Yasuhiro Horiuchi
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsTeamskunkworks
 
Supervisord, The Process Manager
Supervisord, The Process ManagerSupervisord, The Process Manager
Supervisord, The Process Managersamof76
 
Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...
Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...
Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...ScaleBase
 
Distributed RDBMS: Challenges, Solutions & Trade-offs
Distributed RDBMS: Challenges, Solutions & Trade-offsDistributed RDBMS: Challenges, Solutions & Trade-offs
Distributed RDBMS: Challenges, Solutions & Trade-offsAhmed Magdy Ezzeldin, MSc.
 
Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014
Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014
Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014Minh Nguyen Vo Cao
 
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)Amazon Web Services
 
Brugnoli System Ux
Brugnoli System UxBrugnoli System Ux
Brugnoli System Uxfrog
 
2015 ZendCon - Do you queue
2015 ZendCon - Do you queue2015 ZendCon - Do you queue
2015 ZendCon - Do you queueMike Willbanks
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011Mike Willbanks
 

Andere mochten auch (20)

In the Back of Your Mind
In the Back of Your MindIn the Back of Your Mind
In the Back of Your Mind
 
Asynchronous Awesome
Asynchronous AwesomeAsynchronous Awesome
Asynchronous Awesome
 
Open Source 2.0
Open Source 2.0Open Source 2.0
Open Source 2.0
 
Tối ưu hóa việc ghi dữ liệu với Gearman
Tối ưu hóa việc ghi dữ liệu với GearmanTối ưu hóa việc ghi dữ liệu với Gearman
Tối ưu hóa việc ghi dữ liệu với Gearman
 
Job_Queues
Job_QueuesJob_Queues
Job_Queues
 
Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)
Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)
Low Latency Logging with RabbitMQ (PHP London - 4th Sep 2014)
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
 
1秒間に250通のメールをさばくAWSの使い方
1秒間に250通のメールをさばくAWSの使い方1秒間に250通のメールをさばくAWSの使い方
1秒間に250通のメールをさばくAWSの使い方
 
AWSが誕生するまでの秘話
AWSが誕生するまでの秘話AWSが誕生するまでの秘話
AWSが誕生するまでの秘話
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applications
 
Supervisord, The Process Manager
Supervisord, The Process ManagerSupervisord, The Process Manager
Supervisord, The Process Manager
 
Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...
Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...
Distributed RDBMS: Data Distribution Policy: Part 1 - What is a Data Distribu...
 
Distributed RDBMS: Challenges, Solutions & Trade-offs
Distributed RDBMS: Challenges, Solutions & Trade-offsDistributed RDBMS: Challenges, Solutions & Trade-offs
Distributed RDBMS: Challenges, Solutions & Trade-offs
 
Gearman for MySQL
Gearman for MySQLGearman for MySQL
Gearman for MySQL
 
Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014
Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014
Creating a WebSocket-Chat-Application with Jetty Embedded - Techcamp 2014
 
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
AWS re:Invent 2016: Deep Dive on Amazon Aurora (DAT303)
 
Scaling php
Scaling phpScaling php
Scaling php
 
Brugnoli System Ux
Brugnoli System UxBrugnoli System Ux
Brugnoli System Ux
 
2015 ZendCon - Do you queue
2015 ZendCon - Do you queue2015 ZendCon - Do you queue
2015 ZendCon - Do you queue
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
 

Ähnlich wie Gearman, Supervisor and PHP - Job Management with Sanity!

DevOps For Small Teams
DevOps For Small TeamsDevOps For Small Teams
DevOps For Small TeamsJoe Ferguson
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsJoe Ferguson
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamJoe Ferguson
 
ZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsJoe Ferguson
 
Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistranosagar junnarkar
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2Merixstudio
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!進錕 林進錕
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleArnaud LEMAIRE
 
Forensic tools for in-depth performance investigations
Forensic tools for in-depth performance investigations Forensic tools for in-depth performance investigations
Forensic tools for in-depth performance investigations SOASTA
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsNicholas Jansma
 
Running operations in 2 hours at DevTernity 2015
Running operations in 2 hours at DevTernity 2015Running operations in 2 hours at DevTernity 2015
Running operations in 2 hours at DevTernity 2015Erno Aapa
 
WordPress automation and CI
WordPress automation and CIWordPress automation and CI
WordPress automation and CIRan Bar-Zik
 
Debugging and Profiling PHP Applications
Debugging and Profiling PHP ApplicationsDebugging and Profiling PHP Applications
Debugging and Profiling PHP ApplicationsLogan Lindquist
 
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...Zoltan Balazs
 
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 

Ähnlich wie Gearman, Supervisor and PHP - Job Management with Sanity! (20)

DevOps For Small Teams
DevOps For Small TeamsDevOps For Small Teams
DevOps For Small Teams
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small Teams
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
 
ZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small Teams
 
Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistrano
 
Why we choose Symfony2
Why we choose Symfony2Why we choose Symfony2
Why we choose Symfony2
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!轉轉轉好運旺來一起來之雲端轉檔大作戰!
轉轉轉好運旺來一起來之雲端轉檔大作戰!
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
 
Forensic tools for in-depth performance investigations
Forensic tools for in-depth performance investigations Forensic tools for in-depth performance investigations
Forensic tools for in-depth performance investigations
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance Investigations
 
Deployment talk dpc 13
Deployment talk dpc 13Deployment talk dpc 13
Deployment talk dpc 13
 
DevOps for Developers
DevOps for DevelopersDevOps for Developers
DevOps for Developers
 
Running operations in 2 hours at DevTernity 2015
Running operations in 2 hours at DevTernity 2015Running operations in 2 hours at DevTernity 2015
Running operations in 2 hours at DevTernity 2015
 
WordPress automation and CI
WordPress automation and CIWordPress automation and CI
WordPress automation and CI
 
Debugging and Profiling PHP Applications
Debugging and Profiling PHP ApplicationsDebugging and Profiling PHP Applications
Debugging and Profiling PHP Applications
 
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
 
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
 

Kürzlich hochgeladen

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 connectorsNanddeep Nachan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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.pdfsudhanshuwaghmare1
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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 WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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 Processorsdebabhi2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
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...Zilliz
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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...DianaGray10
 
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...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Kürzlich hochgeladen (20)

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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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...
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Gearman, Supervisor and PHP - Job Management with Sanity!

  • 1. Supervisor, Gearman and PHP - Job management with sanity! ABU ASHRAF MASNUN
  • 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
  • 7. Gearman: How it works? Understanding Gearman
  • 8. Gearman: Installation Are you ready? QR Code Install Gearman: sudo apt-get install gearman Install Libgearman: sudo apt-get install libgearman-dev Install the PHP Extension: sudo pecl install channel://pecl.php.net/gearman-0.8.0
  • 9. Gearman: Daemonizing! Starting Gearman QR Code Running Gearman Daemon: sudo gearman –d –u root Debugging Gearman (Verbose mode) : sudo gearman –d -vvv –u root
  • 11. QR Code Gearman: Workers Breaking it down!
  • 12. QR Code Gearman: Workers Breaking it down!
  • 13. QR Code Gearman: Clients Requesting a job!
  • 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!
  • 17. Supervisor: Installation! Let’s go! QR Code sudo apt-get install python-setuptools sudo easy_install supervisor
  • 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?
  • 21. That was Simple! Eh? Got anything to ask?
  • 22. The Leevian! Who am I? ABU ASHRAF MASNUN Software Engineer @ Leevio http://masnun.com masnun@leevio.com