Created
August 1, 2014 08:28
-
-
Save serg-kovalev/a201e89e69ee5a86ad79 to your computer and use it in GitHub Desktop.
Monitor your Phusion passenger instances. This script allows you to automatically gracefully reload passenger instances (if they ate too much memory). See the required library: https://gist.github.com/serg-kovalev/71af1ccd121fba7ef56e
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
#!/usr/bin/env ruby | |
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'passenger_monitor')) | |
# Set logger to log into Rails project /log directory and start monitoring | |
PassengerMonitor.run( | |
:log_file => File.join(File.dirname(__FILE__), '..', 'log', 'passenger_monitor.log'), | |
:memory_limit => 400, # this is in MB | |
:wait_time => 10, # this in seconds (timeout before attempts) | |
:attempts => 5 # number of attempts | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment