Efficient monitoring of your Gearman cluster is essential as a bottleneck can have a direct influence on the functioning of the job servers involved. Gearman monitoring helps to keep a check on how the distributed processes communicate and view all the critical metrics in a single, intuitive dashboard.
This document details how to configure the Gearmand server plugin and the monitoring metrics for providing in-depth visibility into the performance, availability, and usage stats of Gearmand servers.
Gearman server monitoring metrics:
Site24x7 plugins offer insightful visualizations and timely alerts to ensure continued functioning of your Gearman job server (also known as Gearmand).
Various out-of-the-box metrics we support are:
Number of running jobs
The running metric shows how many jobs are currently running
Number of queued jobs
The queued metric shows the number of jobs in queue waiting to be completed
After the job server finds a suitable worker, the worker performs the work requested by the client and sends a response to the client through the job server. The time involved in this process is calculated by the response_time metric
Number of unique tasks
The unique_tasks is the total number of identical functions registered with the Gearman server
Number of workers
The workers metric shows the maximum possible count of workers that could be doing this job
- Site24X7 Gearman plugin uses Python's "Gearman" package to collect metrics
sudo pip install gearmanorsudo easy_install gearman
Gearman plugin installation:
- Create a directory with the name "gearmanmon", under Site24x7 Linux agent plugin directory - /opt/site24x7/monagent/plugins/
sudo mkdir gearmanmon
- Download the gearmanmon.py from our GitHub repository and place it under the "gearmanmon" directory
sudo wget https://raw.githubusercontent.com/site24x7/plugins/master/gearmanmon/gearmanmon.py
- The default python path given in the plugin script is #!/usr/bin/python. If you wish to provide an alternate python path, replace the existing one preceded by the shebang character "#!".
- Change the values of host and port to match your configuration
- The server agent will report stats on the performance of Gearman under the Plugins tab in the Site24x7 web client. In case the plugin is not listed in the Site24x7 web client, restart the agent.
sudo /etc/init.d/site24x7monagent restart
- Create a directory with the name "gearmanmon", under Site24x7 Windows agent plugin directory - C:\Program Files\Site24x7\WinAgent\monitoring\Plugins\
- Download gearmanmon.py from our GitHub repository and place it under the "gearmanmon" directory
- Download gearmanmon.ps1 and place it under "gearmanmon" directory
- Replace the existing python path in $python="C:\Python27\python.exe" with your path in the "gearmanmon.ps1" file
- The Site24x7 Windows agent will now report stats on the performance of the Gearman server under the Plugins tab in the Site24x7 web client
Monitoring additional metrics:
- To monitor additional metrics, edit the "gearmanmon.py" file and add the new metrics that need monitoring
- Increment the plugin version value in the file to view the newly added metrics (For e.g., change the default plugin version from PLUGIN_VERSION = "1" to "PLUGIN_VERSION = "2")
- Redis plugin - Monitor performance metrics of your Redis databases
- MongoDB plugin - Monitor performance metrics of your MongoDB databases
- Memcached plugin - Analyze performance of your Memcached server
- Nagios plugin - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
- Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
- Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes