Skip to content

Instantly share code, notes, and snippets.

View yifan-gu's full-sized avatar

Yifan Gu yifan-gu

  • San Francisco
View GitHub Profile
@yifan-gu
yifan-gu / no_fallocate.txt
Created February 26, 2015 23:50
no fallocate
PASS
BenchmarkWrite100EntryWithoutBatch 50 37415004 ns/op
BenchmarkWrite100EntryBatch10 500 3276359 ns/op
BenchmarkWrite100EntryBatch100 10000 362926 ns/op
BenchmarkWrite100EntryBatch500 20000 72593 ns/op
BenchmarkWrite100EntryBatch1000 50000 38534 ns/op
BenchmarkWrite1000EntryWithoutBatch 50 42914454 ns/op
BenchmarkWrite1000EntryBatch10 500 3900643 ns/op
BenchmarkWrite1000EntryBatch100 10000 386800 ns/op
BenchmarkWrite1000EntryBatch500 20000 81089 ns/op
first
second
panic: close of closed channel
goroutine 5 [running]:
github.com/godbus/dbus.(*Conn).Close(0xc208000a20, 0x0, 0x0)
/home/yifan/gopher/src/github.com/godbus/dbus/conn.go:178 +0x62
github.com/godbus/dbus.(*Conn).inWorker(0xc208000a20)
/home/yifan/gopher/src/github.com/godbus/dbus/conn.go:334 +0x10be
created by github.com/godbus/dbus.(*Conn).Auth
@yifan-gu
yifan-gu / testsystem.go
Created February 12, 2015 01:09
testsystemd.go
package main
import (
"fmt"
"github.com/coreos/go-systemd/dbus"
)
func main() {
fmt.Println("first")
I0211 09:39:53.466158 22648 server.go:169] Both --etcd_servers and --api_servers are set. Not using etcd source.
W0211 09:39:53.466268 22648 server.go:240] Could not load kubernetes auth path: stat /home/yifan/gopher/src/github.com/GoogleCloudPlatform/kubernetes/hack/.test-cmd-auth: no such file or directory. Continuing with defaults.
I0211 09:39:53.466304 22648 docker.go:657] Connecting to docker on unix:///var/run/docker.sock
I0211 09:39:53.466323 22648 util.go:76] Sending events to api server.
I0211 09:39:53.466381 22648 server.go:360] Watching apiserver
I0211 09:39:53.466462 22648 plugins.go:112] Loaded volume plugin "kubernetes.io/empty-dir"
I0211 09:39:53.466478 22648 plugins.go:112] Loaded volume plugin "empty"
I0211 09:39:53.466497 22648 plugins.go:112] Loaded volume plugin "kubernetes.io/gce-pd"
I0211 09:39:53.466509 22648 plugins.go:112] Loaded volume plugin "gce-pd"
I0211 09:39:53.466527 22648 plugins.go:112] Loaded volume plugin "kubernetes.io/git-repo"
@yifan-gu
yifan-gu / pseudo.md
Last active August 29, 2015 14:11
pseudo

��

Sender: 
gossip() {
    for (i = 0; i < fanout; i++ ) {
    q = getPeer();
    send (msg, q);
}
@yifan-gu
yifan-gu / wci.md
Last active August 29, 2015 14:08
who computes id.

#####Problem:

  1. Agent A has an address addA. The address addA also has an aliases addA'.

  2. When A starts, it uses addA as its address, so it computes its id = ID(addA)

  3. Another agent B starts, it wants to join A, but it only knows the aliases address of A, that is addA', so it uses this address to to compute the id of A, which is ID(addA').

  4. Later, when A and B exchange information, A will see an id = ID(addA'), and treat it as a different node from itself, thus A will then send message to itself.

#####To solve the problem:

##Our project:

####Decentralized Membership System for Health Check and Service Discovery. (For clarification, we are proposing an engineering project, not a research topic. We want to open source this project, and hope we can use this in real production environment in the future.)

Problem we want to solve: Relieve the load on central coordinator, thus improve the scalability.

Why we think this might be a problem:

@yifan-gu
yifan-gu / loosen2.log
Created August 29, 2014 02:56
loosen2 (5,7, 10000)
0 makeup: 37648 breakup: 6410
1 makeup: 357 breakup: 197
2 makeup: 49 breakup: 18
3 makeup: 43 breakup: 21
4 makeup: 37 breakup: 32
5 makeup: 0 breakup: 0
6 makeup: 0 breakup: 0
7 makeup: 0 breakup: 0
@yifan-gu
yifan-gu / loosen1.log
Created August 29, 2014 02:55
loosen (5,6, 10000)
0 makeup: 54097 breakup: 25033
1 makeup: 57 breakup: 83
2 makeup: 76 breakup: 79
3 makeup: 71 breakup: 51
4 makeup: 56 breakup: 80
5 makeup: 71 breakup: 32
6 makeup: 49 breakup: 70
7 makeup: 50 breakup: 38
8 makeup: 46 breakup: 53
9 makeup: 46 breakup: 48
@yifan-gu
yifan-gu / strict.log
Created August 29, 2014 02:53
strict (5,5, 10000)
0 makeup: 89727 breakup: 68091
1 makeup: 1992 breakup: 2043
2 makeup: 64 breakup: 62
3 makeup: 1923 breakup: 1955
4 makeup: 94 breakup: 90
5 makeup: 88 breakup: 94
6 makeup: 93 breakup: 88
7 makeup: 88 breakup: 95
8 makeup: 92 breakup: 89
9 makeup: 84 breakup: 89