Skip to content

Instantly share code, notes, and snippets.

View SaveTheRbtz's full-sized avatar

Alexey Ivanov SaveTheRbtz

View GitHub Profile
diff --git a/source/common/upstream/load_balancer_impl.cc b/source/common/upstream/load_balancer_impl.cc
index 185652b66..09816b0cf 100644
--- a/source/common/upstream/load_balancer_impl.cc
+++ b/source/common/upstream/load_balancer_impl.cc
@@ -1,7 +1,10 @@
#include "common/upstream/load_balancer_impl.h"
+#include <algorithm>
#include <cstdint>
+#include <limits>
diff --git a/src/core/malloc.c b/src/core/malloc.c
index 32c20353..83f3e980 100644
--- a/src/core/malloc.c
+++ b/src/core/malloc.c
@@ -98,7 +98,7 @@ size_t freemem;
*
* Currently fixed at 512kB.
*/
-#define HEAP_SIZE ( 512 * 1024 )
+#define HEAP_SIZE ( 4 * 1024 * 1024 )
commit 9ed0fd60880a7359db62605f6f8a578f621e6326
Author: Alexey Ivanov <rbtz@dropbox.com>
Date: Sat Oct 12 16:55:05 2019 +0000
[DBX] net-tcp_bbr: v2: disable spurious warning
This warning is due to the fact that tcp_simple_retransmit() calls
tcp_set_ca_state(sk, TCP_CA_Loss);
@SaveTheRbtz
SaveTheRbtz / boringssl.diff
Last active May 6, 2019 22:55
Re-enable AVX2/SHA extensions that were disabled after OpenSSL->BoringSSL fork.
diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl
index 73db3c2b..ab517119 100755
--- a/crypto/bn/asm/rsaz-avx2.pl
+++ b/crypto/bn/asm/rsaz-avx2.pl
@@ -84,8 +84,8 @@ die "can't locate x86_64-xlate.pl";
# output, so this isn't useful anyway.
#
# TODO(davidben): Enable these after testing. $avx goes up to 2 and $addx to 1.
-$avx = 0;
-$addx = 0;
#!/bin/bash
#
# https://www.redhat.com/archives/rhl-list/2007-September/msg03735.html
# https://github.com/hiboma/hiboma/blob/master/kernel/net/softnet_stat.md
#
cmd="${0##*/}"
usage() {
@SaveTheRbtz
SaveTheRbtz / edgemap-log.txt
Last active August 7, 2018 22:13
Edge Location Preference computation
Loaded airports: 1035
Loaded GDPs: 209
Loaded cities: 25032
Top cities:
City(name='tokyo', country='jp', population=31480498, gdppc=34523.7007742331, latlong=(35.685, 139.751389), region='40')
City(name='new york', country='us', population=8107916, gdppc=56115.7184261955, latlong=(40.7141667, -74.0063889), region='NY')
City(name='london', country='gb', population=7421228, gdppc=43929.6908131028, latlong=(51.514125, -0.093689), region='H9')
City(name='seoul', country='kr', population=10323448, gdppc=27221.5240509661, latlong=(37.5985, 126.9783), region='11')
City(name='sydney', country='au', population=4394585, gdppc=56290.6468086817, latlong=(-33.861481, 151.205475), region='02')
City(name='los angeles', country='us', population=3877129, gdppc=56115.7184261955, latlong=(34.0522222, -118.2427778), region='CA')
@SaveTheRbtz
SaveTheRbtz / ip_vs_sch.c
Last active July 12, 2018 12:01
Consistent source hashing scheduler for IPVS (SH-derivative, GPL)
/*
* IPVS: Source Consistent Hashing scheduling module
*
* Authors: Jonathan Lee <jonlee@dropbox.com>
*
* Changes:
*
*/
#define KMSG_COMPONENT "IPVS"
$ numactl --membind=1 --cpunodebind=1 dd if=/dev/zero of=/dev/null bs=64M count=100
100+0 records in
100+0 records out
6710886400 bytes (6.7 GB) copied, 0.911091 s, 7.4 GB/s
$ numactl --membind=0 --cpunodebind=1 dd if=/dev/zero of=/dev/null bs=64M count=100
100+0 records in
100+0 records out
6710886400 bytes (6.7 GB) copied, 1.28833 s, 5.2 GB/s
@SaveTheRbtz
SaveTheRbtz / Makefile
Last active January 12, 2017 10:14
Measure performance of qsort(3) vs std::sort()
CXX = $${CXX:-c++}
CXXFLAGS = -std=c++11 -O3
CC = $${CC:-cc}
CFLAGS = -O3
all: sort_cpp sort_c test
sort_cpp: sort.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
@SaveTheRbtz
SaveTheRbtz / userspaceswap.c
Last active December 5, 2016 22:20
Ugly hack to redirect all malloc calls to a mmap(2)'ed file.
/*
* Redirect malloc(3) calls to a mmap(2)'ed file.
*
* Example of usage:
* $ cc -shared -o userspaceswap.dylib ./userspaceswap.c && \
* DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=./userspaceswap.dylib ffmpeg
*/
#include <dlfcn.h>
#include <errno.h>