Skip to content

Instantly share code, notes, and snippets.

View kofemann's full-sized avatar
Working on the next great thing....

Tiramisu Mokka kofemann

Working on the next great thing....
View GitHub Profile
@kofemann
kofemann / 10G-sysctl.conf
Last active December 13, 2023 12:44
sysctl configuration for 10GE ethernet
#
# Based on info providef at http://fasterdata.es.net/
#
# allow testing with buffers up to 64MB
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
# Enable memory auto tuning
net.ipv4.tcp_moderate_rcvbuf = 1
@kofemann
kofemann / tuned.conf
Last active November 1, 2023 07:44
Tuned profile for PostgreSQL server on CENTOS-7
#
# tuned configuration for PostgresSQL servers
# /usr/lib/tuned/postgres-db-server/tuned.conf
#
[cpu]
force_latency=1
governor=performance
energy_perf_bias=performance
min_perf_pct=100
@kofemann
kofemann / nfs_pdml.py
Last active July 13, 2023 12:34
Simple python script to parse NFS packes in pdml file generated by wireshark
#!/usr/bin/env python3
# Licensed under GNU GENERAL PUBLIC LICENSE Version 2
#
# parses files produced by : `tshark -r file.pcap -q -n -T pdml`
#
import xml.sax
import sys
@kofemann
kofemann / draft-mkrtchyan-token-based-storage-access.md
Last active July 8, 2023 21:55
Tocken based storage access problem statement

Token-based storage access problem statement

by Tigran Mkrtchyan, Deutsches Elektronen-Synchrotron DESY, June 2023.

Status of this Memo

By submitting this Internet-Draft, I certify that any applicable patent or other IPR claims of which I am aware have been disclosed, or will be disclosed, and any of which I become aware will be disclosed, in accordance with RFC 3668.

DATA AND METADATA COHERENCE
Some modern cluster file systems provide perfect cache coherence among their clients. Perfect cache coherence among disparate NFS clients is expensive to achieve, especially on wide area networks. As such, NFS settles for weaker cache coherence that satisfies the requirements of most file sharing types.
Close-to-open cache consistency
Typically file sharing is completely sequential. First client A opens a file, writes something to it, then closes it. Then client B opens the same file, and reads the changes.
When an application opens a file stored on an NFS version 3 server, the NFS client checks that the file exists on the server and is permitted to the opener by sending a GETATTR or ACCESS request. The NFS client sends these requests regardless of the freshness of the file's cached attributes.
When the application closes the file, the NFS client writes back any pending changes to the file so that the next opener can view the changes. This al
@kofemann
kofemann / giava-java8-future.md
Last active April 6, 2023 07:36
Howto migrate from guava's Listenablefuture to java8 completableFuture
@kofemann
kofemann / vscode-init.py
Last active April 4, 2023 13:36
Make vscode ready for kernel development
#!/usr/bin/env python3
# This program runs "make --dry-run" then processes the output to create a visual studio code
# c_cpp_properties.json file
# Origin:
# https://iotexpert.com/2020/06/01/stupid-python-tricks-vscode-c_cpp_properties-json-for-linux-kernel-development/
# by: Alan Hawse
import json
@kofemann
kofemann / postgres-cluster.yaml
Created May 1, 2020 16:41
Running postgres in kubernetes
#
# postgres cluster in kubernetes with max 8 replicas
#
# the master is always on ${host}-0
#
#
# postgres master/slave configuration
#
@kofemann
kofemann / NettyGroupBenchmark.java
Last active October 30, 2022 05:21
Netty Event loop benchmark
package dev.kofemann.playground;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.epoll.EpollEventLoopGroup;
@kofemann
kofemann / CreateBenchmark.java
Last active August 29, 2022 12:54
Simple chimera file freate rate benchmark
package org.dcache.chimera.posix;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.UUID.randomUUID;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import java.io.FileReader;
import java.io.IOException;