Skip to content

Instantly share code, notes, and snippets.

View bsparrow435's full-sized avatar

Brian Sparrow bsparrow435

View GitHub Profile
@kellymclaughlin
kellymclaughlin / pb_status_anon.txt
Created September 28, 2012 21:18
How to get poolboy status for each Riak Vnode
PBStatusFun = fun() ->
VnodePids = [Pid || {_, Pid} <- riak_core_vnode_manager:all_index_pid(riak_kv_vnode)],
Links = [process_info(Pid, [links]) || Pid <- VnodePids],
WorkerPoolPids = [WPPid || [{links,[_, WPPid]}] <- Links],
WorkerPoolLinks = [process_info(Pid, [links]) || Pid <- WorkerPoolPids],
PoolboyPids = [PoolboyPid || [{links,[_, PoolboyPid]}] <- WorkerPoolLinks],
[poolboy:status(Pid) || Pid <- PoolboyPids]
end.
PBStatusFun = fun(Index) ->
@rzezeski
rzezeski / gist:3250870
Created August 3, 2012 19:53
detect bad merge index files
#!/usr/bin/env escript
%% -*- erlang -*-
-include_lib("kernel/include/file.hrl").
-compile(export_all).
-define(LOG(S), io:format(S)).
-define(LOG(S,A), io:format(S,A)).
main(Dirs) ->
CodePath = case os:getenv("RIAK_LIB") of
-module(timeit).
-compile(export_all).
%% @doc Dynamically add timing to MFA. There are various types of
%% timing.
%%
%% all - time latency of all calls to MFA
%%
%% {sample, N, Max} - sample every N calls and stop sampling after Max
%%
@gburd
gburd / haproxy.conf
Last active July 5, 2022 13:34
Recommended haproxy settings to balance Riak protobuf and http interfaces (note: WORK IN PROGRESS)
# Documentation for HAProxy
# http://code.google.com/p/haproxy-docs/w/list
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
# NOTES:
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems)
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice