We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder
python -m venv ./venv
#!/bin/bash | |
PID=$1 | |
RUBY_BINARY=`which ruby` | |
BT_FILENAME="/tmp/ruby-backtrace-$PID-$(date +%s).txt" | |
cmdfile=$(mktemp) | |
cat <<EOF > $cmdfile | |
set \$old_stdout = dup(1) | |
set \$old_stderr = dup(2) |
require 'resque/tasks' | |
namespace :resque do | |
def del(key) | |
Resque.redis.keys(key).each { |k| Resque.redis.del(k) } | |
end | |
desc "Resque setup according to installation guide" | |
task :setup => :environment |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
#!/bin/bash | |
# Also see: http://vitobotta.com/resque-automatically-kill-stuck-workers-retry-failed-jobs/ | |
[[ -f /tmp/retry-failed-resque-jobs ]] && rm /tmp/retry-failed-resque-jobs | |
ps -eo pid,command | | |
grep [r]esque | | |
grep "Processing" | | |
while read PID COMMAND; do |
module ObjectDiagnostics | |
extend self | |
#This is handy when you want to determine what types of objects are contributing to memory bloat | |
#returns the change in object counts since the last time this method was called | |
def change_in_object_counts | |
#this will start all counts at 0 for the initial run | |
@previous_counts ||= Hash.new(0) |