Giter VIP home page Giter VIP logo

process-monitor's Introduction

process-monitor

The process monitor will monitor a set of external (outside of Erlang) processes and restart them if nescessary. The process monitor uses erlang ports (open_port) to start external processes.

The system reads the file pm.config to configure the processes and supervision strategy. The pm.config file is located in the INSTALL_DIR/etc directory. The file has the following format:

{SupervisorGroupName, RestartSpec, [JobSpec]}.

You can have multiple entries in the file.

Where: SupervisorGroupName is an atom(). This atom will be appended to the pm_sup and must be unique.

RestartSpec is a Supervisor RestartSpec.

JobSpec is {JobName, "Number Of Processes to create", "Process to Run"}, eg

{metadata_jobs, 5, "/usr/local/bin/metadata_parser -s"}

The JobName must be an atom() and must be unique within a particular Supervisor Group. The job name is appended to pm_server along with an incrementing count for each process.

For example, given an entry like:

{metadata_processing, {one_for_one, 500, 10},
    [{extract_metadata, 3, "/usr/bin/metadata_parser -s"},
     {index_md, 2, "/usr/bin/md_indexer -f /tmp"}]}.

This will start 3 /usr/bin/metadata_parser commands, and 2 /usr/bin/md_indexer commands. Inside the Erlang VM it will create one supervisor named 'pm_sup_metadata_processing', and 5 workers named "pm_server_extract_metadata_1", "pm_server_extract_metadata_2", "pm_server_extract_metadata_3", "pm_server_index_md_1", and "pm_server_index_md_2".

The supervisor pm_sup_metadata_processing will have {one_for_one, 500, 10} as its restart spec.

You can have multiple entries in the file. For example:

{metadata_processing, {one_for_one, 500, 10},
    [{extract_metadata, 3, "/usr/bin/metadata_parser -s"},
     {index_md, 2, "/usr/bin/md_indexer -f /tmp"}]}.

{text_extracter, {one_for_all, 20, 5},
    [{step_1, 2, "/usr/local/bin/extracter -q Extracter"},
     {step_2, 5, "/usr/local/bin/loader -q Loader -f /tmp"}]}.

This will create two supervisor groups. Each of the separate supervisors will manage their respective processes in a different manner.

process-monitor's People

Contributors

gtarcea 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.