Skip to content

Instantly share code, notes, and snippets.

View maurorappa's full-sized avatar

maurorappa maurorappa

  • zerolatency
  • Asso
View GitHub Profile
How many write syscalls?
# perf stat -e 'syscalls:sys_enter_writev' -p 546925
^C
Performance counter stats for process id '546925':
9 syscalls:sys_enter_writev
3.400728456 seconds time elapsed
microservices in containers without overengineering
all communications by BUS (easy to monitor everything, easy to add new sites, easy to test, easy to implement business logic )
all messages in json with schema (allows easy parsing/storage/replay and multiple service versions to coexists)
central db and Redis NOT in the cluster (shared storage as single point of truth, no cache sync problem)
api routing with nginx or openresty (http routing inside the gateway, no application gw)
@maurorappa
maurorappa / Dockerfile
Last active October 10, 2024 08:01
container for collecting server performance in a nice complete json
FROM gcc:11.2.0 as build
RUN apt update && apt install -y p7zip fio python3 g++ ipmitool groff-base dmidecode perl vim python3-pymongo && mkdir /hwtest
COPY . hwtest/
RUN ln -s /usr/local/bin/gcc /usr/bin/gcc && mkdir /etc_phy /data
RUN cd /hwtest && g++ -O3 -DNDEBUG c2clat.cpp -o c2clat -pthread
RUN cd /hwtest && tar xf memtester-4.6.0.tar.gz && tar xf primegen-0.97.tar.gz && cp /hwtest/memtester.c /hwtest/memtester-4.6.0/ && cp /hwtest/primespeed.c /hwtest/primegen-0.97/
RUN cd /hwtest/primegen-0.97/ && make && cp /hwtest/primegen-0.97/primespeed /bin/primespeed
RUN cd /hwtest/memtester-4.6.0/ && make && cp /hwtest/memtester-4.6.0/memtester /bin/memtester
RUN git clone https://github.com/cruvolo/ramspeed-smp.git && cd ramspeed-smp && echo |bash build.sh && cp ramsmp /bin/ramsmp
RUN git clone https://github.com/eembc/coremark-pro.git coremark-pro && cd coremark-pro && make TARGET=linux64 XCMD='-c4' all
@maurorappa
maurorappa / client.go
Last active October 10, 2024 07:59
workload simulator for VM overprovisioning testing
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"github.com/BurntSushi/toml"
"github.com/kavehmz/prime"
"io/ioutil"