Skip to content

Instantly share code, notes, and snippets.

View SaveTheRbtz's full-sized avatar

Alexey Ivanov SaveTheRbtz

View GitHub Profile
@SaveTheRbtz
SaveTheRbtz / patch-apc_red.patch
Created December 3, 2011 00:18
APC cache: RED As Workaround For Thundering Herd Problem
Index: apc_cache.c
===================================================================
--- apc_cache.c (revision 320057)
+++ apc_cache.c (working copy)
@@ -705,6 +705,13 @@
volatile apc_cache_entry_t* value = NULL;
unsigned long h;
+ /* APC-RED PATCH */
+ const int drop_cf = 75;
@SaveTheRbtz
SaveTheRbtz / who-sponsors-freebsd.txt
Created February 5, 2012 02:14
FreeBSD sponsors sorted by no. of commits
$ git log | perl -nle 'print $1 if /.*Sponsored by:\s+(?:The )?(.+?)\b.*/'|sort|uniq -c|sort -nr
1160 DARPA
330 FreeBSD
202 Isilon
146 Google
96 Sandvine
85 iXsystems
64 TCP
56 Juniper
47 Nokia
@SaveTheRbtz
SaveTheRbtz / gist:2117117
Created March 19, 2012 15:55 — forked from verm666/gist:2049204
djb2.py
#!/usr/bin/env
# -*- coding: utf-8 -*-
from collections import Counter
from contextlib import contextmanager
def djb2(uuid):
""" See for details: http://www.cse.yorku.ca/~oz/hash.html """
_hash = 5381
@SaveTheRbtz
SaveTheRbtz / aggregate_filestat.py
Created April 16, 2012 10:46
Linux per-file IO statistics
#!/usr/bin/env python
import logging as log
from fileinput import input
from collections import namedtuple, defaultdict
from pprint import pprint
if __debug__:
log_level = log.DEBUG
else:
@SaveTheRbtz
SaveTheRbtz / linux_tcp_timeout_knobs.patch
Last active June 24, 2021 14:02
On the fly TCP timeout tuning for linux-3.2
commit 99f490afdc91d4965aafd5629567ef02c515e169
Author: Alexey Ivanov <rbtz@yandex-team.ru>
Date: Tue Apr 17 16:55:10 2012 +0400
YANDEX: tcpm: Added TCP sysctl tunables
I made following constants tunable for internal testing:
TCP_DELACK_MIN -> net.ipv4.tcp_delack_min
TCP_DELACK_MAX -> net.ipv4.tcp_delack_max
TCP_ATO_MIN -> net.ipv4.tcp_ato_min
@SaveTheRbtz
SaveTheRbtz / Python_Essential_Reference_errata.rst
Last active October 3, 2015 20:28
My tiny errata for Python Essential Reference

Errata for Python Essential Reference

Fourth Edition (by David M. Beazley)

Chapter 9

p. 170 ++++ I'm myself by no means UTF-8 guru but there is some inconsistency with RFC3629:

@SaveTheRbtz
SaveTheRbtz / 80-iosched.rules
Created June 15, 2012 15:02
/etc/udev/rules.d/80-iosched.rules
root@ws36-000:~# cat /etc/udev/rules.d/80-iosched.rules
# Default CFQ settings does not perform well in our environment. Switch it to
# IOPS mode and use NCQ.
#
# XXX: This applies even for SATA drives. If you want to disable IOPS mode on
# SATA drives uncomment following line:
#ENV{ID_BUS}=="ata", GOTO="end_iosched"
SUBSYSTEM!="block", GOTO="end_iosched"
KERNEL=="dm-*", GOTO="end_iosched"
@SaveTheRbtz
SaveTheRbtz / Linux_Kernel_Development_errata_and_wishlist.rst
Created July 10, 2012 00:47
My wishlist for next edition of Linux Kernel Development

Linux Kernel Development

Third Edition by Robert Love is an excellent book, but still there is a way for improvement. I'll attached tiny errata and my wishlist below.

Chapter 7: Interrupts and Interrupt Handlers

Wishlist

@SaveTheRbtz
SaveTheRbtz / gist:3734928
Created September 17, 2012 00:09
tcp: Added knobs to tune initial window sizes
commit e4d08801d7cfb46a2f8cd46049c455f63d85a064
Author: Alexey Ivanov <rbtz@yandex-team.ru>
Date: Wed Jul 18 22:14:36 2012 +0400
YANDEX: tcp: Added knobs to tune initial window sizes
Added following sysctls
/* TCP initial congestion window */
TCP_INIT_CWND -> net.ipv4.tcp_init_cwnd
@SaveTheRbtz
SaveTheRbtz / gist:3734932
Last active October 10, 2015 18:48
Added "fade" readahead type
commit e95636528228a11ed22e5d17e160d69325e8572f
Author: Alexey Ivanov <rbtz@yandex-team.ru>
Date: Tue Jul 31 01:48:45 2012 +0400
YANDEX: Added "fade" readahead type
This replaces comlicated logic with simple one:
* If we've already read more than file size -- read 8 pages
* Else if we read more than file size / 2 -- read (ra_pages / 4) pages
* Otherwise read 8 pages