Skip to content

Instantly share code, notes, and snippets.

View braz's full-sized avatar

Eoin Brazil braz

View GitHub Profile
/*
* Auto-tuning delete that allows for removal of large amounts of data
* without impacting performance. Configurable to a target load amount.
*
* How it works:
* TL;DR: Delete a small slice every second; Vary the size of each slice
* based on how long the previous delete took; sleep; repeat.
*
* TODO: Modify this to allow for deletion based on objectid's date
* which is embedded in the first four bytes.
@mlafeldt
mlafeldt / postmortem.md
Last active October 10, 2024 04:08
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@ogrisel
ogrisel / haswell-n1-highmem-32-xeon-2.30GHz.txt
Last active May 27, 2016 13:33
Utility script to time the effective memory bandwidth of CPUs
model name : Intel(R) Xeon(R) CPU @ 2.30GHz
Loading arrays to memory
Loading speed: 0.670GB/s
timing bandwidth for sequential memory access
bandwidth: 9.0 GB/s
n_workers=2 (threads)
@brendangregg
brendangregg / decade.md
Last active April 15, 2022 04:08
decade quick benchmarks

There are some quick benchmarks for the "Decade of Wasted Cores" patches on Linux 4.1. I had to add "extern int sched_max_numa_distance;" to arch/x86/kernel/smpboot.c for Linux 4.1 to compile. Brief analysis during the benchmarks using time(1) and mpstat(1) to check runtimes, usr/sys time, and per-CPU balance; iostat(1) to check for disk bottlenecks.

Summary: no significant difference seen in these tests.

c3.8xlarge (32 CPU) PV 1-node NUMA

The patch shouldn't make a difference to this 1-node system, but I felt it worth checking, especially since most of our systems are 1-node.

@atcuno
atcuno / gist:3425484ac5cce5298932
Last active April 5, 2025 06:45
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@kiantabrizi
kiantabrizi / getTotalSizeofDatabases.js
Created June 30, 2015 14:54
MongoDB Cloud Manager Backup: calculating how much you will be charged
var dbNames = [];
var sum = 0;
var dblist = db.getMongo().getDBs();
for (var key in dblist) {
if(key === "databases") {
for (var i = 0; i < dblist.databases.length; i++){
if (dblist.databases[i].name !== "local") {
dbNames.push(dblist.databases[i].name);
}
}
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@vdm
vdm / ixgbevf-upgrade.sh
Last active November 28, 2019 21:35
ixgbevf 2.16.1 upgrade for AWS EC2 SR-IOV "Enhanced Networking" on Ubuntu 14.04 (Trusty) LTS
ssh ubuntu@n.n.n.n "bash -s -x" -- <ixgbevf-upgrade.sh
diff --git a/include/net/tcp.h b/include/net/tcp.h
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -285,6 +285,7 @@
extern int sysctl_tcp_adv_win_scale;
extern int sysctl_tcp_tw_reuse;
extern int sysctl_tcp_frto;
+extern int sysctl_tcp_syn_acceptq_pct;
extern int sysctl_tcp_low_latency;
extern int sysctl_tcp_dma_copybreak;
// kills long running ops in MongoDB (taking seconds as an arg to define "long")
// attempts to be a bit safer than killing all by excluding replication related operations
// and only targeting queries as opposed to commands etc.
killLongRunningOps = function(maxSecsRunning) {
currOp = db.currentOp();
for (oper in currOp.inprog) {
op = currOp.inprog[oper-0];
if (op.secs_running > maxSecsRunning && op.op == "query" && !op.ns.startsWith("local")) {
print("Killing opId: " + op.opid