CodeSamplez.com

Programming, Web development, Cloud Technologies

  • Facebook
  • Google+
  • RSS
  • Twitter
  • Home
  • Featured
    • C# Tutorials
      • LinQ Tutorials
      • Facebook C# API Tutorials
    • PHP Tutorials
      • CodeIgniter Tutorials
    • Amazon AWS Tutorials
  • Categories
    • Programming
    • Development
    • Database
    • Web Server
    • Source Control
    • Management
    • Project
  • About
  • Write
  • Contact
Home Management Using Supervisord Web Interface And Plugin

Using Supervisord Web Interface And Plugin

Rana Ahsan July 8, 2014 Leave a Comment


 Using Supervisord Web Interface And Plugin    

On my last article where I tried to give an introduction and basic usage of supervisord process monitoring, I figured that there are two missing features there which someone should know about/aware of. Which are, interacting with supervisord web interface and using a plugin with supervisord.

So, today, In this small article, I will try to cover these two to make your supervisord experience more easier/better. Lets start with the built-in web interface.

Supervisord Web Interface:

To access the basic web interface, edit the supervisord configuration file(located at /etc/supervisord.conf) in the following section:

[inet_http_server]         ; inet (TCP) server disabled by default
port=127.0.0.1:9001        ; (ip_address:port specifier, *:port for all iface)
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

You just have to comment out the first two-line to get it working. After that, run the supervisord in no daemon mode(with -n param) and you should be able to see something like below in the console log:

2014-07-08 05:25:40,558 CRIT Server 'inet_http_server' running without any HTTP authentication checking

Which means that, it started properly. Now, test the web interface at http://127.0.0.1:9001 url, which will look like something like below:

Supervisord-basic-interface

As you can see on the screenshot, you can start/stop/restart, see status, log etc right from your browser. Pretty cool! Isn’t it?

Third Party Web Interface:

There are some available third-party web interfaces available which might be helpful to integrate on a web application. You can find details about them on supervisod third-party libraries page. Besides easy integration with a web application, some of them also facilitate monitoring more than one server from single web interface, which is useful in many cases.

Using Plugin:

To use a plugin for additional functionality to our existing supervisord installation, it can be easily configurable via the same configuraiton file.

A very useful such package is superlance. It is a plugin that includes few very useful plugins for supervisord. I will show you one example configuration here for the ‘memmon’ plugin here. ‘Memmon’ is a plugin that monitors the memory used by the processes and can restart the processes as soon as they go beyond the given boundary size.

After having superlance on system, edit the configuraiton file as below for the memmon plugin:

[eventlistener:memmon]
command=memmon -p my-bg-tasks=170MB -m yourname@domain.com
events=TICK_60

The above configuration will cause momemon to monitor memory usage over 170MB and restart if goes beyond that. It also attaches an event to send signal every 60 seconds. Now, if the configuration is OK, after start the supervisord again, with no daemon mode(with -n param), you should see something similar to the following line on std log:

2014-07-08 05:25:41,564 INFO spawned: 'memmon' with pid 1600

To test this, try to keep the memory allowance low and feed your worker process with large data, you should eventually see that, the worker restarted with separate process id.

Final Words:

So, I hope this article will be helpful to you in some extent. You are most welcome to question/ provide feedback/suggestions via comments. Keep in touch!

Related

Filed Under: Management Tagged With: process, server, utility

About Rana Ahsan

Rana is a passionate software engineer/Technology Enthusiast.
Github: ranacseruet

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Email Subscription

Never miss any programming tutorial again.

Popular Tutorials

  • PHP HTML5 Video Streaming Tutorial
  • How To Work With JSON In Node.js / JavaScript
  • Generate HTTP Requests using c#
  • How To Work With C# Serial Port Communication
  • Facebook C# API Tutorials
  • LinQ To SQL Database Update Operations In C#
  • How To Work With CodeIgniter Pagination
  • How To Work With Multithreaded Programming In C#.NET Application
  • Get Facebook C# Api Access Token
  • How To Work With Codeigniter Caching In PHP

Recent Tutorials

  • Building Auth With JWT – Part 1
  • Document Your REST API Like A Pro
  • Understanding Golang Error Handling
  • Web Application Case Studies You Must Read
  • Getting Started With Golang Unit Testing
  • Getting Started With Big Data Analytics Pipeline
  • NodeJS Tips And Tricks For Beginners
  • Apple Push Notification Backend In NodeJS
  • Web Based Universal Language Translator, Voice/Text Messaging App
  • How To Dockerize A Multi-Container App From Scratch

Recent Comments

  • intolap on PHP HTML5 Video Streaming Tutorial
  • manishpanchal on PHP HTML5 Video Streaming Tutorial
  • Rana Ghosh on PHP HTML5 Video Streaming Tutorial
  • ld13 on Pipe Email To PHP And Parse Content
  • Daniel on PHP HTML5 Video Streaming Tutorial

Archives

Resources

  • CodeSamplez.com Demo

Tags

.net apache api audio aws c# cache cloud server codeigniter deployment doctrine facebook git github golang htaccess html5 http image java javascript linq mysql nodejs oop performance php phpmyadmin plugin process python regular expression scalability server smarty ssh tfs thread tips ubuntu unit-test utility web application wordpress wpf

Copyright © 2010 - 2021 · CodeSamplez.com ·

Copyright © 2021 · Streamline Pro Theme on Genesis Framework · WordPress · Log in