Skip to content

Instantly share code, notes, and snippets.

View gist:f0d15ba76bf38cce99c22d97269c285e
127.0.0.1 - - [24/Aug/2020:09:33:19 +0900] "GET /100x10k/ HTTP/3" 200 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4242.0 Safari/537.36" "-, stream-id=0, packets-received=10,packets-decryption-failed=0,packets-sent=10,packets-lost=0,packets-ack-received=8,bytes-received=3549,bytes-sent=6356,rtt-minimum=22,rtt-smoothed=22,rtt-variance=6,rtt-latest=25,cwnd=18215"
127.0.0.1 - - [24/Aug/2020:09:33:19 +0900] "GET /100x10k/10k.jpg?1 HTTP/3" 200 0 "https://127.0.0.1.examp1e.net:8444/100x10k/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4242.0 Safari/537.36" "-, stream-id=4, packets-received=20,packets-decryption-failed=0,packets-sent=41,packets-lost=0,packets-ack-received=17,bytes-received=5784,bytes-sent=43911,rtt-minimum=22,rtt-smoothed=22,rtt-variance=1,rtt-latest=22,cwnd=28975"
127.0.0.1 - - [24/Aug/2020:09:33:19 +0900] "GET /100x10k/10k.jpg?2 HTTP/3" 200 0 "https://127.0.0.1.examp1e.net:8444/100x
View gist:3cb91075625db57c3f18f7850f09d6bb
# /etc/exports (macOS)
/mydev -mapall=user:group -network 127.0.0.1 -mask 255.255.255.0
# /etc/nfsd.conf (macOS)
nfs.server.udp=0
nfs.server.tcp=1
nfs.server.mount.port=635
nfs.server.mount.require_resv_port=0
nfs.server.require_resv_port=0
View gist:68611a6fdc80a86414d95b84cd55994f
{"type":"accept", "conn":0, "time":1593928818423, "dcid":"274076836d80b1a8", "address-token":"0x0"}
{"type":"crypto-decrypt", "conn":0, "time":1593928818423, "pn":1, "decrypted":"0x7ffee816f7a3", "decrypted-len":1315}
{"type":"quictrace-recv", "conn":0, "time":1593928818423, "pn":1}
{"type":"stream-receive", "conn":0, "time":1593928818423, "stream-id":-1, "off":0, "len":512}
{"type":"crypto-handshake", "conn":0, "time":1593928818423, "ret":0}
{"type":"send", "conn":0, "time":1593928818426, "state":1, "dcid":""}
{"type":"packet-prepare", "conn":0, "time":1593928818426, "first-octet":192, "dcid":""}
{"type":"ack-send", "conn":0, "time":1593928818426, "largest-acked":1, "ack-delay":2}
{"type":"stream-send", "conn":0, "time":1593928818426, "stream-id":-1, "off":0, "len":90, "is-fin":0}
{"type":"quictrace-send-stream", "conn":0, "time":1593928818426, "stream-id":-1, "off":0, "len":90, "fin":0}
View gist:92f38b999f143ba1406ae7d51eca9cea
{"type":"accept", "conn":3, "time":1593905003402, "dcid":"d9d9a7fb9fe2036e", "address-token":"0x0"}
{"type":"crypto-decrypt", "conn":3, "time":1593905003402, "pn":1, "decrypted":"0x7ffee793f7a3", "decrypted-len":1315}
{"type":"quictrace-recv", "conn":3, "time":1593905003402, "pn":1}
{"type":"stream-receive", "conn":3, "time":1593905003402, "stream-id":-1, "off":0, "len":512}
{"type":"crypto-handshake", "conn":3, "time":1593905003402, "ret":0}
{"type":"send", "conn":3, "time":1593905003405, "state":1, "dcid":""}
{"type":"packet-prepare", "conn":3, "time":1593905003405, "first-octet":192, "dcid":""}
{"type":"ack-send", "conn":3, "time":1593905003405, "largest-acked":1, "ack-delay":2}
{"type":"stream-send", "conn":3, "time":1593905003405, "stream-id":-1, "off":0, "len":90, "is-fin":0}
{"type":"quictrace-send-stream", "conn":3, "time":1593905003405, "stream-id":-1, "off":0, "len":90, "fin":0}
@kazuho
kazuho / procstat
Created Jun 19, 2020
script for collecting CPU and network usage
View procstat
#! /usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Scope::Guard;
my $nic;
GetOptions("nic=s" => \$nic);
View benchmark.md

Setup

*** sysctl

  • net.core.rmem_default=8MB
  • net.core.wmem_default=2MB

GSO size: Number of packets

@kazuho
kazuho / fusionbench.c
Last active Sep 22, 2020
Tiny benchmark program for picotls-fusion
View fusionbench.c
/*
* Copyright (c) 2020 Fastly, Kazuho Oku
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
View gist:37d860d8199fb69e0043f5dd2e92dca3
# コンパイル
gcc -fno-lto -march=native -O2 -fno-unroll-loops -I include lib/picotls.c lib/fusion.c t/fusionbench.c
# それぞれのパラメータで動かし、スループット(-bの値 x -nの値 / 所要時間)を計算
time ./a.out -b 1440 -n 10000000
time ./a.out -b 1440 -n 10000000 -s
time ./a.out -b 16384 -n 1000000
time ./a.out -b 16384 -n 1000000 -s
View fusionbench.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "picotls/fusion.h"
int main(int argc, char **argv)
{
static const uint8_t key[16] = {}, iv[12] = {}, aad[13] = {};
ptls_fusion_aesgcm_context_t ctx;
View fusionbench.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "picotls/fusion.h"
int main(int argc, char **argv)
{
static const uint8_t key[16] = {}, iv[12] = {}, aad[13] = {};
ptls_fusion_aesgcm_context_t ctx;
You can’t perform that action at this time.