Skip to content

Instantly share code, notes, and snippets.

@cortezcristian
Last active July 26, 2016 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cortezcristian/5ab4fdddcc573972d44873f1e97a2b88 to your computer and use it in GitHub Desktop.
Save cortezcristian/5ab4fdddcc573972d44873f1e97a2b88 to your computer and use it in GitHub Desktop.
Meteor CPU Limiter
#!/bin/bash
# Author: Cristian Cortez <cortez.cristian@gmail.com>
# Dependencies: cpulimiter
#
# Usage:
# $ sh meteor-cpu-limiter.sh
# Problem the process is taking a lot of resources
# coworkers machines get temperature and their fans makes noice
# $ process & echo $! >/tmp/my-app.pid
# node sample.js & echo $! > /tmp/my-app.pid
# find meteor process
ps ax | grep node | grep meteor | grep -v grep | awk '{print $1}' > /tmp/my-app.pid
# Install utitlity to limit the cpu consumption
# brew install cpulimit
cpulimit --p $(cat /tmp/my-app.pid) --limit 77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment