Skip to content

Instantly share code, notes, and snippets.

@alq666
alq666 / latency.txt
Created January 2, 2019 16:58 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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
@alq666
alq666 / service-checklist.md
Created September 12, 2016 14:32 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
From 504504f2f8c13f077f09e0906cd7e7d3ca405acc Mon Sep 17 00:00:00 2001
From: Vincent Bernat <vincent-5wNQGcxKXm8AvxtiuMwx3w@public.gmane.org>
Date: Wed, 7 May 2014 18:18:07 +0200
Subject: [PATCH] MINOR: dtrace: add dtrace support (WIP)
Both dtrace and systemtap are supported. Currently, only one tracepoint
is defined.
---
.gitignore | 1 +
Makefile | 18 +++++++++++++++++-
@gane5h
gane5h / datadog-nginx
Created October 22, 2014 04:06
Nginx log parsing with datadog
"""
Custom parser for nginx log suitable for use by Datadog 'dogstreams'.
To use, add to datadog.conf as follows:
dogstreams: [path to ngnix log (e.g: "/var/log/nginx/access.log"]:[path to this python script (e.g "/usr/share/datadog/agent/dogstream/nginx.py")]:[name of parsing method of this file ("parse")]
so, an example line would be:
dogstreams: /var/log/nginx/access.log:/usr/share/datadog/agent/dogstream/nginx.py:parse
Log of nginx should be defined like that:
log_format time_log '$time_local "$request" S=$status $bytes_sent T=$request_time R=$http_x_forwarded_for';
when starting dd-agent, you can find the collector.log and check if the dogstream initialized successfully
"""
@bketelsen
bketelsen / ddagent.json
Last active August 29, 2015 14:07
DataDog agent as privileged Pod with Service - collects info on host, and all docker containers. Accepts statsd on port 8125 on every machine.
{
"id": "ddagent",
"kind": "ReplicationController",
"apiVersion": "v1beta1",
"desiredState": {
"replicas": 3,
"replicaSelector": {"name": "ddagent"},
"podTemplate": {
"desiredState": {
"manifest": {
@remh
remh / gist:1426ccb24ec36162ba2b
Last active August 29, 2015 14:03
Datadog Agent 5.0.0

What is Datadog Agent 5.0.0 ?

Datadog Agent 5.0.0 is the next major version of the Datadog Agent. Its main improvement being that it will be self-contained. All dependencies required by the Agent to run will be part of the package.

Warning

This version of the Datadog-Agent is still in beta. It's planned to be released soon and is being used by us and a few of our users without any major issue but please keep in mind that it's a BETA version.

What issues will it solve ?

  • Conflicts with dependencies (Tornado, Supervisor, Check dependencies: MysqlDB, Postgres....)
  • On Centos 5, there is no forwarder which can create some issues (such as no proxy support for Dogstatsd). This will be solved
  • Full support of Fedora Core
@jedi4ever
jedi4ever / datadog-feedback.md
Last active January 4, 2016 08:09
Datadog Feedback 24/01/2014

@datadoghq - Overall well done! Here's some feedback:

Signup/User process

  • when someone invites you to their datadog/team, you get an email but because you are already registered you can't join their team. Especially annoying for freelancers that work for multiple customers but don't have an email account at the customer site
  • disable a user is scary (will this delete it, can I re-create it?); a warning or ? next to it would help for fast understanding
  • if the user you invite does not have it's gmail activated yet (google for apps), when the email is added it's send out (but doesn't reach it of course). There is no way of re-sending the invite from the admin side
  • the forcing of registering at least one agent/integration is really annoying. if you signup through an ipad or the person signing up (like billing) does not have any way to go past that screen. So you wonder , am I registered or not? In our case the person installed the mac agent from it's laptop to get it going. No need for that imho
  • when
@alekstorm
alekstorm / README.md
Last active April 23, 2020 19:00
Ansible callback plugin that posts events to your Datadog event stream as you deploy

Installation

To install, place datadog.py in your callback plugins directory. If you don't yet have one, run:

mkdir -p plugins/callback

Then place the following in your ansible.cfg file:

[defaults]

callback_plugins = ./plugins/callback

@robertsosinski
robertsosinski / postgresql.py
Last active June 25, 2020 10:32
DataDog script for collecting PostgreSQL stats
# Create the datadog user with select only permissions:
# CREATE USER datadog WITH PASSWORD '<complex_password>';
#
# Grant select permissions on a table or view that you want to monitor:
# GRANT SELECT ON <schema>.<table> TO datadog;
#
# Grant permissions for a specific column on a table or view that you want to monitor:
# GRANT SELECT (id, name) ON <schema>.<table> TO datadog;
#
# Let non-superusers look at pg_stat_activity in a read-only fashon.
# you can make a text file of request times (in ms, one number per line) and import it here, or you can use a probability distribution to simulate request times (see below where setting req_durations_in_ms)
# rq = read.table("~/Downloads/request_times.txt", header=FALSE)$V1
# argument notes:
# parallel_router_count is only relevant if router_mode is set to "intelligent"
# choice_of_two, power_of_two, and unicorn_workers_per_dyno are only relevant if router_mode is set to "naive"
# you can only select one of choice_of_two, power_of_two, and unicorn_workers_per_dyno
run_simulation = function(router_mode = "naive",
reqs_per_minute = 9000,