Last active
July 26, 2016 13:16
-
-
Save cortezcristian/5ab4fdddcc573972d44873f1e97a2b88 to your computer and use it in GitHub Desktop.
Meteor CPU Limiter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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