This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go test -bench=. | |
goos: linux | |
goarch: amd64 | |
pkg: pgproxy/internal/helpers | |
cpu: AMD Ryzen 9 3950X 16-Core Processor | |
BenchmarkRingBufferEnqueueDequeueMutex-32 5174512 212.9 ns/op 0 B/op 0 allocs/op | |
BenchmarkRingBufferEnqueueMutex-32 8517314 127.9 ns/op 0 B/op 0 allocs/op | |
BenchmarkRingBufferDequeueMutex-32 16836531 71.17 ns/op 0 B/op 0 allocs/op | |
BenchmarkRingBufferEnqueueDequeueSpinlock-32 3977191 303.1 ns/op 0 B/op 0 allocs/op | |
BenchmarkRingBufferEnqueueSpinlock-32 7919860 146.9 ns/op 0 B/op 0 allocs/op |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with | |
// gcc -O3 -o mbedtls-server-test mbedtls-server-test.c -lmbedtls -lmbedx509 -lmbedcrypto | |
// mbedtls from Ubuntu 22.10 | |
#if !defined(MBEDTLS_CONFIG_FILE) | |
#include "mbedtls/config.h" | |
#else | |
#include MBEDTLS_CONFIG_FILE | |
#endif | |
#if defined(MBEDTLS_PLATFORM_C) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires | |
// https://github.com/danielealbano/cachegrand/blob/41-implement-fibers-support/src/fiber.c | |
// https://github.com/danielealbano/cachegrand/blob/41-implement-fibers-support/src/fiber.h | |
// https://github.com/danielealbano/cachegrand/blob/41-implement-fibers-support/src/fiber.s | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include "fiber.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
memtier_benchmark \ | |
-s cachegrand-server-01 \ | |
-p "6379" \ | |
-c "100" \ | |
-t "48" \ | |
--print-percentiles=50,90,95,99,99.5,99.9,100 \ | |
--command="PING" \ | |
-x 5 \ | |
-x 5 > output-benchmark-ping.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lscpu | |
Architecture: x86_64 | |
CPU op-mode(s): 32-bit, 64-bit | |
Byte Order: Little Endian | |
Address sizes: 43 bits physical, 48 bits virtual | |
CPU(s): 48 | |
On-line CPU(s) list: 0-47 | |
Thread(s) per core: 2 | |
Core(s) per socket: 24 | |
Socket(s): 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt update | |
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" upgrade | |
apt install -y build-essential autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev libssl-dev iftop htop git nload | |
cd /usr/local/src | |
git clone https://github.com/RedisLabs/memtier_benchmark.git | |
cd memtier_benchmark/ | |
autoreconf -ivf | |
./configure | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# INITIAL SETUP (for both testers and main server) | |
# Install required packages | |
sudo apt update && \ | |
sudo apt upgrade -y && \ | |
sudo apt install -y git wget curl build-essential gdb cmake libevent-dev autoconf automake libpcre3-dev libevent-dev pkg-config zlib1g-dev libssl-dev | |
# UPGRADE UBUNTU KERNEL TO 5.10.15 | |
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh && \ | |
chmod +x ubuntu-mainline-kernel.sh && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before applying this k8s deployment is necessary to adjust the labels specified in the | |
# selctor to match the ones in use in your kubernetes cluster. | |
# It is in addition necessary to replace the __ACCESS_TOKEN__, __REPO_URL__, __REPO_NAME__ | |
# placeholders, the gitlab runner are per repo or per organization, they can't be assigned | |
# directly to an user. | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: github-runner-__REPO_NAME__-arm64-rpi4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RPI4 SSD1306 Status Display - v0.2 - 2020/12/04 - 11.46 PM GMT | |
# Requires a 128x32 I2C SSD1306 OLED display | |
# | |
# Author Daniele Albano <https://github.com/danielealbano> | |
# | |
# It displays a number of status information for the RPI4 | |
# - Memory usage | |
# - Cpu load (per CPU) | |
# - Temperature | |
# - Network traffic (no loopback) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile with | |
// gcc -Wall dev-input-reader.c -o dev-input-reader | |
// | |
// run with | |
// sudo dev-input-reader | |
// | |
// example output | |
// { "source": "/dev/input/event26", "device": { "name": " USB Keyboard", "location": "usb-0000:00:14.0-9/input0" }, "event": null } | |
// { "source": "/dev/input/event29", "device": { "name": "Logitech MX Master 2S", "location": "usb-0000:00:14.0-10/input2:1" }, "event": null } | |
// { "source": "/dev/input/event26", "device": null, "event": { "timestamp": 1605658367, "type": "EV_MSC", "type_id": 4, "code": "MSC_SCAN", "code_id": 4, "value": 458792 } } |
NewerOlder