Skip to content

Instantly share code, notes, and snippets.

@ShadySQL
ShadySQL / newrelic.h
Last active August 29, 2015 14:08 — forked from kimlindholm/newrelic.h
/*
* Add X-Request-Start header so we can track queue times in New Relic RPM
*/
#include <stdio.h>
#include <sys/time.h>
struct timeval detail_time;
gettimeofday(&detail_time, NULL);
char start[20];
@ShadySQL
ShadySQL / run
Last active August 29, 2015 14:08 — forked from kimlindholm/run
#!/bin/sh
# Daemontools run script for starting Varnish
exec 2>&1
exec echo | mail -s "Varnish in Tokyo restarting" admin@example.com
exec varnishd -F -s malloc,130M -u nobody -g nobody -p cli_timeout=30 \
-p thread_pool_add_delay=2 -p thread_pool_min=400 -p thread_pool_max=4000 \
-p session_linger=100 -f /etc/varnish/varnish.tokyo.vcl -T 127.0.0.1:2000 \
-a 0.0.0.0:80
------ Slide 8 ------
sudo su -
yum install -y gcc make pkgconfig pcre-devel ncurses-devel
cd /usr/src
wget http://repo.varnish-cache.org/source/varnish-3.0.2.tar.gz -O - | tar xz
cd varnish-3.0.2
./configure
make && make install
exit