Skip to main content

A script that kills processes of users generating excessive load.It is meant with HPC login nodes in mind.

Project description

Kill hogs

We at team HPC of the university of Groningen run job schedueling clusters. Some users are running their programs on the login node of these clusters instead of submitting jobs. This leads to a high load on the login node, which leads to unhappy users who are unable to submit jobs. "kill hogs" is a crude attempt at mittigating these problems. It is a cronjob that checks the resources (cpu and ram) that are used by each user. If they reach a certain treshold, all the user's processes above a minimum treshold are killed. The user is informed of this via a message in the terminal. A message is also send to slack to inform us.

this program might kill processes you don't want killed and lock you out

Installation.

We install the cronjob via ansible on a centos7 host instead of installing the requirements with pip, we opt for the following yum packages.

  • python36-requests
  • python36-psutil

The cronjob looks like this:

*/2 * * * * root /usr/bin/python36 /opt/kill_hoggs/kill_hoggs.py --slack

Run tests

python -m unittest unittests.test_kill_hogs

# Or if you want coverage information.
coverage run -m unittest unittests.test_kill_hogs
coverage report -m kill_hogs.py

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kill hogs-0.1.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distributions

kill_hogs-0.1-py3.7.egg (17.1 kB view hashes)

Uploaded Source

kill_hogs-0.1-py3-none-any.whl (21.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page