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
From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001 | |
From: Ilya Grigorik <[email protected]> | |
Date: Thu, 10 Jun 2010 00:46:48 -0400 | |
Subject: [PATCH] async rails3 | |
--- | |
Gemfile | 6 ++++++ | |
app/controllers/widgets_controller.rb | 6 ++++++ | |
app/models/widget.rb | 2 ++ | |
config.ru | 1 + |
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 | |
# | |
# Find bloating passengers and kill them gracefully. Run from cron every minute. | |
# | |
# required for passenger since cron has no environment | |
ENV['HTTPD'] = 'httpd' | |
MEM_LIMIT = ARGV[0] || 500 | |
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
# Used to graph results from autobench | |
# | |
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv | |
# | |
# This will generate three svg & png graphs | |
require "rubygems" | |
require "scruffy" | |
require 'csv' | |
require 'yaml' |
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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
require 'logger' | |
class Logger | |
class Formatter | |
private | |
def msg2str(msg) | |
case msg | |
when ::String | |
"msg (pid: #{$$})" | |
when ::Exception |
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
# source: http://gist.github.com/452539 | |
# thanks to EP on | |
# http://groups.google.com/group/phusion-passenger/ | |
# browse_thread/thread/a3221e0e15adc1ec | |
# [logger per spawner] | |
# add it to config/initializer in rails | |
# tested with rails-2.3.5 | |
# simply giving the pid in the config will not work as it will be the |
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 | |
# NOTE: does not make sense to measure for large iterations, only as | |
# much as the logging being done on rails request, it is not as if on | |
# on a request 10K logging is done. With 50 logging statements i would | |
# prefer syslog | |
# NOTE: Also in buffered and syslog the | |
# log can get lost but logger is more reliable | |
# TODO: measure IO perf, if syslog logs on remote the io cost will be |
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 | |
# NOTE: does not make sense to measure for large iterations, only as | |
# much as the logging being done on rails request, it is not as if on | |
# on a request 10K logging is done. With 50 logging statements i would | |
# prefer syslog | |
# NOTE: Also in buffered and syslog the | |
# log can get lost but logger is more reliable | |
# TODO: measure IO perf, if syslog logs on remote the io cost will be |
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 | |
# NOTE: does not make sense to measure for large iterations, only as | |
# much as the logging being done on rails request, it is not as if on | |
# on a request 10K logging is done. With 50 logging statements i would | |
# prefer syslog | |
# NOTE: Also in buffered and syslog the | |
# log can get lost but logger is more reliable | |
# TODO: measure IO perf, if syslog logs on remote the io cost will be |
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
# source: http://github.com/rtomayko/dotfiles/blob/rtomayko/.reerc | |
# baseline REE environment settings for server environments | |
# http://www.rubyenterpriseedition.com/documentation.html#_garbage_collector_performance_tuning | |
## ruby defaults | |
# RUBY_HEAP_MIN_SLOTS=10000 | |
# RUBY_HEAP_SLOTS_INCREMENT=10000 | |
# RUBY_HEAP_SLOTS_GROWTH_FACTOR=1.8 | |
# RUBY_GC_MALLOC_LIMIT=8000000 |