Git Product home page Git Product logo

artisan-pm2-demo's Introduction

Artisan PM2 Demo

The goal of this repo is to show how we could go about setting up PM2 to monitor some of the Laravel long running artisan commands, such as serve, queue:work or queue:listen

Introduction

PM2 Runtime is a Production Process Manager for Node.js applications with a built-in Load Balancer. It allows you to keep applications alive forever, to reload them without downtime and facilitate common Devops tasks.

However, this would essentially be a drop-in replacement for something like Supervisord.

The advantages of using PM2 over something like supervisord is :

  • It is written in Node so it's super fast and easy to install.
  • Processes configuration is saved in the code and can be versioned.

Installing PM2

With yarn:

$ yarn global add pm2

With npm:

$ npm install pm2 -g

Run the Processes we've defined

A convinent way to define processes is with an Ecosystem File. This file is committed with the repo and contains definition of processes to be run. See the complete documentation here.

Now to run our processes we only need to do :

$ pm2 start

To stop a process we just run :

$ pm2 stop <app_name>

To delete process we just need to run :

$ pm2 delete <app_name>

artisan-pm2-demo's People

Contributors

percymamedy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.