1. Introduction to MFSERV

1.1. What is mfserv?

This in the Metwork Framework “SERVices” module. This module is a kind of private PAAS which help to develop, run and manage webservices applications.

With this module, you can easily implement robust webservices with:

  • synchronous Python3 and synchronous Python2 (with a custom virtualenv including the framework you want like Django, Flask…)

  • asynchronous Python3 (with aiohttp and your custom virtualenv)

  • nodejs (and your custom node_modules)

All these technologies are managed in a “production ready” with:

  • a dynamically configured nginx webserver in front

  • some multiple workers in back

  • memory limits

  • autorestart features

  • logs and metrics

1.2. How it works?

image

MSERV relies on the following components:

  • Circus monitors and controls processes and sockets. Circus acts as a process watcher and runner. You may check the full circus.ini configuration file in the tmp/config_auto/ in the root directory of the mfadmin user. Check the Circus architecture

  • Telegraf acts as a server agent for collecting and sending metrics and events from databases, systems, and IoT sensors.

  • Elasticsearch is a distributed, RESTful search and analytics engine.

  • Nginx acts as a web server container.

  • jsonlog2elasticsearch is a daemon to send json logs read from a log file to elasticsearch.

  • mflog2mfadmin (based jsonlog2elasticsearch) is a daemon to send mflog logs to elasticsearch.

  • conf_monitor is a Metwork tool in order to monitor the configuration files.

Circus acts as a process watcher and runner. You may check the full circus.ini configuration file in the /home/mfserv/tmp/config_auto/ directory. Check the Circus architecture

app-{{PLUGIN.name}}.{{APP.name}} is the app defines in your plugin. There are as many app-{{PLUGIN.name}}.{{APP.name}} as plugins. You may have more than one app in the same plugin.

Thanks to its plugin templates, MFSERV ease you into a web server implementation:

If the MFSERV plugin is configured for monitoring, the metrics are send via Telegraf to the InfluxDB database on the MFADMIN server.

See also

MFADMIN Documentation
mfadmin:mfadmin_monitoring_plugins
mfadmin:mfadmin_miscellaneous:Circus hooks

1.3. MFSERV configuration

The configuration of the MFSERV and its components is stored in the config/config.ini file of the root directory of the mfserv user. Check this file for further information.