alexdean / beancounter Goto Github PK
View Code? Open in Web Editor NEWPython script to monitor resource overruns in OpenVZ guests.
Home Page: http://www.deanspot.org/content/monitor-resource-overruns-openvz
Python script to monitor resource overruns in OpenVZ guests.
Home Page: http://www.deanspot.org/content/monitor-resource-overruns-openvz
OpenVZ is a great virtualization tool for Linux servers, but not the friendliest to configure. I've repeatedly run up against various resource limits, which can sometimes lead to really weird errors like 'cannot allocate memory' when you do something awful like 'ls -l'. I cooked up the following script to keep a log file of times when a server overruns its bounds. I can then either raise the limits, or try to correlate the overrun time to something going on at that time. The script will examine the /proc/user_beancounters file and print any 'failcnt' values which have changed since the last run. Set up a cron job every minute (or whatever frequency you like), and redirect output to get an easy failure log. * * * * * /usr/local/bin/beancount.py >> /var/log/beancount.log This has to be run as root, since a non-root user cannot read the user_beancounters file. It works equally well when run from a guest OS or from a host OS. If run from the host, you'll get monitoring of all guests. It doesn't track how long it's been since the last run, which you'd need for calculating failures/second or some other rate. I'm working on the assumption that these failures should be fairly rare, and you're most interested in the fact that they're happening at all. Some possible enhancements: * Add syslog or other logging facilities in addition to stdout.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.