Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
# fork to create a detatched server process... (this should be on a different host)
rd,wr = IO.pipe
spid = fork do
rd.close
# turn of noise
STDIN.reopen "/dev/null"
STDOUT.reopen "/dev/null", "a"
STDERR.reopen STDOUT
user system total real
4kb std
Memory: 24.1015625 MB
0.000000 0.010000 0.320000 ( 0.404393)
4kb patron
Memory: 22.265625 MB
0.000000 0.000000 0.070000 ( 0.188609)
4kb curb
Memory: 28.5703125 MB
0.000000 0.000000 0.130000 ( 0.140266)
# Massif output graph showing memory usage. There is possibly a minor improvement to total memory allocation when using a Hash
# to store Curl::Easy VALUE options. The measures will vary depending on the use case tested... I ran these against the easy
# test suite since, it has fairly good coverage of the Curl::Easy options.
#
# Without Dynamic Options:
#
--------------------------------------------------------------------------------
Command: ruby tests/tc_curl_easy.rb
Massif arguments: (none)
ms_print arguments: massif.out.18439
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *_GeoIP_num_to_addr (void* gi, unsigned long ipnum) {
char *ret_str;
char *cur_str;
int octet[4];
int num_chars_written, i;
diff -u ext/openssl/ossl.c ext/openssl/ossl.c
--- ext/openssl/ossl.c 2009-12-30 09:43:44.000000000 -0500
+++ ext/openssl/ossl.c 2009-12-30 09:42:12.000000000 -0500
@@ -92,7 +92,7 @@
#define OSSL_IMPL_SK2ARY(name, type) \
VALUE \
-ossl_##name##_sk2ary(STACK *sk) \
+ossl_##name##_sk2ary(STACK_OF(type) *sk) \
{ \
node-waf
Traceback (most recent call last):
File "/Users/taf2/work/builds/bin/node-waf", line 16, in <module>
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/Users/taf2/work/builds/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/Users/taf2/work/builds/bin/../lib/node/wafadmin/Scripting.py", line 94, in prepare_impl
Utils.set_main_module(os.path.join(candidate, WSCRIPT_FILE))
File "/Users/taf2/work/builds/bin/../lib/node/wafadmin/Utils.py", line 283, in set_main_module
g_module = load_module(file_path, 'wscript_main')
upstream clientApp {
server 127.0.0.1:3001;
}
upstream clientData {
server 127.0.0.1:3002;
}
server {
listen 80;
check process unicorn-leads with pidfile /var/www/apps/leads/shared/pids/unicorn.pid
start program = "/home/deployer/ruby/bin/ruby /var/www/apps/leads/current/script/spin start"
stop program = "/home/deployer/ruby/bin/ruby /var/www/apps/leads/current/script/spin stop"
group leads
if totalmem is greater than 420.0 MB for 5 cycles # eating up memory?
then exec "/bin/bash -c 'kill -s USR2 `cat /var/www/apps/leads/shared/pids/unicorn.pid`'"
function hex2rgb(hex) {
var toDec = function(v) {
switch(v) {
case 'a': case 'A': return 10;
case 'b': case 'B': return 11;
case 'c': case 'C': return 12;
case 'd': case 'D': return 13;
case 'e': case 'E': return 14;
case 'f': case 'F': return 15;
default: return parseInt(v);
y = 0;
for( var i = 0, len = this.visible; i < len; ++i ) {
ctx.save();
var img = this.images[i+this.index];
ctx.drawImage(img, x, y, w, h);
ctx.save();
//var ny = y - ch - (rh*2); // offset from the bottom so should be negative value
var ny = -1*(ch + ((h+y) - ch) + rh);