SlideShare a Scribd company logo
GO IN BADOO
Go meetup April 2015
Anton Povarov	

antoxa@corp.badoo.com
Marko Kevac	

m.kevac@corp.badoo.com
BADOO BACKEND IN 2013
• PHP	

• C/C++ (~25 home-made daemons)	

• Python
BADOO BACKEND IN 2014
• PHP	

• C/C++ (~25 home-made daemons)	

• Python	

• Go
INFRASTRUCTURE
INFRASTRUCTURE
• Same config, same logging, same directory structure	

• Same protocol, including JSON to Protobuf conversion	

• Build and testing inTeamCity	

• QA team should not know this is a Go project
Go is not special in any way
INFRASTRUCTURE
• Logs go to syslog and eventually to Splunk	

• Metrics are collected with home-grown system based on
RRD (you will see some examples)	

• HTTP based profiling is always on
INFRASTRUCTURE
• As of now we do not use vendoring	

• We use go get for dependencies	

• Sometimes we just fork projects (as with rocksdb lib)	

• We use Make for building
BUMPED
when two people meet somewhere in the world
BUMPED
• Done in a week	

• By three people	

• Huge win for product
~2800 req/sec
~2800 req/sec
~54 GiB in memory
~2800 req/sec ~54 GiB in memory
~900 M objects
~2800 req/sec ~54 GiB in memory ~900 M objects
30 sec GC pause :-(	

~ 200 ms avg response ;-(
DO NOT GIVE UP
DO NOT GIVE UP
for {
generateSomeLoad()
go tool pprof -alloc_objects http://.../debug/pprof/heap
go tool pprof -inuse_objects http://.../debug/pprof/heap
think()
go build -gcflags=-m foobar.go
thinkAndFix()
}
MEMORY PROFILING CRASH COURSE
MEMORY PROFILING CRASH COURSE
Allocating on stack	

!
• Fast	

• No GC pressure	

• Stack size is not fixed in Go	

• Not always possible
Allocating on heap	

!
• Slower	

• GC pressure	

• Always possible
type Person struct {
Name string
Age uint
}
var People []*Person
const PeopleCount = 10000000
func allocateInitial() { ...
func allocateMore() { ...
!
!
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
allocateInitial()
go allocateMore()
http.ListenAndServe("localhost:8080", nil)
}
MEMORY PROFILING CRASH COURSE
func allocateMore() {
for {
for i := 0; i < PeopleCount; i++ {
People = append(People, &Person{"marko", 29})
}
People = People[0:PeopleCount]
time.Sleep(10 * time.Second)
}
}
func allocateInitial() {
for i := 0; i < PeopleCount; i++ {
People = append(People, &Person{"marko", 29})
}
}
MEMORY PROFILING CRASH COURSE
ESCAPE ANALYSIS
$ go build -gcflags=-m
# github.com/mkevac/test002
./test.go:20: &Person literal escapes to heap
./test.go:27: &Person literal escapes to heap
$ go tool pprof —inuse_objects ./test002 http://.../debug/pprof/heap
(pprof) top10
10617157 of 10618977 total ( 100%)
Dropped 3 nodes (cum <= 53094)
flat flat% sum% cum cum%
9945392 93.66% 93.66% 9945392 93.66% main.allocateInitial
671765 6.33% 100% 671765 6.33% main.allocateMore
0 0% 100% 9945392 93.66% main.main
0 0% 100% 10617157 100% runtime.goexit
0 0% 100% 9945392 93.66% runtime.main
ALLOCATIONS
(pprof) list main.allocateInitial
Total: 10618977
ROUTINE ======================== main.allocateInitial in /Users/marko/goprojects/src/
github.com/mkevac/test002/test.go
9945392 9945392 (flat, cum) 93.66% of Total
. . 15:
. . 16:const PeopleCount = 10000000
. . 17:
. . 18:func allocateInitial() {
. . 19: for i := 0; i < PeopleCount; i++ {
9945392 9945392 20: People = append(People, &Person{"marko", 29})
. . 21: }
. . 22:}
. . 23:
. . 24:func allocateMore() {
. . 25: for {
ALLOCATIONS
(pprof) weblist main.allocateInitial
$ go tool pprof —alloc_objects ./test002 http://.../debug/pprof/heap
(pprof) top10
191993610 of 191995430 total ( 100%)
Dropped 3 nodes (cum <= 959977)
flat flat% sum% cum cum%
182048182 94.82% 94.82% 182048182 94.82% main.allocateMore
9945428 5.18% 100% 9945428 5.18% main.allocateInitial
0 0% 100% 9945428 5.18% main.main
0 0% 100% 191993610 100% runtime.goexit
0 0% 100% 9945428 5.18% runtime.main
http://localhost:8080/debug/pprof/heap?debug=1
# NextGC = 1619939888
# PauseNs = [144830 87026 98881 2162680 2990228 3759763 6233690 11810930 18442986
34012539 47019926 72834183 114591578 178384506 315007729 480245709 568020053
575784519 517883227 518861595 604910252 514458210 542329937 560007420 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
# NumGC = 24
GC pause:	

~500 ms
$ GODEBUG=gctrace=1 ./test002
gc16(1): 1+16+433413+1 us, 396 -> 793 MB, 15766167
(15766492-325) objects, 8 goroutines, 61633/1/0 sweeps, 0(0)
handoff, 0(0) steal, 0/0/0 yields
read more: http://goo.gl/jRIyGg
gc16(1): // 16th GC (1 thread was doing it)
!
1+16+433413+1 us, // GC prepare + sweep + mark + finalise
!
396 -> 793 MB, // heap grew from X to Y since last GC
!
15766167 (15766492-325) objects,
// 15766167 objects in heap (incl. garbage)
// 15766492 allocs - 325 frees
!
8 goroutines,
61633/1/0 sweeps, // 61633 total spans, 1 in bg, 0 in pause
!
0(0) handoff, 0(0) steal, 0/0/0 yields
// some scheduling stats :)
read more: http://goo.gl/jRIyGg
$ wrk --latency -d 60s 'http://localhost:8080/debug/pprof/'
Running 1m test @ http://localhost:8080/debug/pprof/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 26.37ms 100.32ms 751.54ms 93.65%
Req/Sec 7.56k 2.47k 9.56k 89.05%
Latency Distribution
50% 687.00us
75% 1.02ms
90% 11.59ms
99% 550.23ms
831369 requests in 1.00m, 507.43MB read
Requests/sec: 13848.63
Transfer/sec: 8.45MB
DEBUGCHARTS
• Memory Allocated	

• GC Pauses	

• Shows data for last 24h
https://github.com/mkevac/debugcharts
import _ "github.com/mkevac/debugcharts"
GC pause:	

500 ms
MEMORY PROFILING CRASH COURSE (FIXED)
type Person struct {
Name [6]byte // was string
Age uint
}
var People []Person // was []*Person
const PeopleCount = 10000000
func allocateMore() {
for {
for i := 0; i < PeopleCount; i++ {
People = append(People,
Person{[6]byte{'m', 'a', 'r', 'k', 'o', 0}, 29})
}
People = People[0:PeopleCount]
time.Sleep(10 * time.Second)
}
}
$ go tool pprof —inuse_objects ./test003 http:/…/debug/pprof/heap
(pprof) top10
1820 of 1824 total (99.78%)
Dropped 8 nodes (cum <= 9)
flat flat% sum% cum cum%
1820 99.78% 99.78% 1820 99.78% mcommoninit
0 0% 99.78% 1820 99.78% runtime.rt0_go
0 0% 99.78% 1820 99.78% runtime.schedinit
$ go tool pprof —alloc_objects ./test003 http://.../debug/pprof/heap
(pprof) top10
1856 of 1858 total (99.89%)
Dropped 4 nodes (cum <= 9)
flat flat% sum% cum cum%
1820 97.95% 97.95% 1820 97.95% mcommoninit
36 1.94% 99.89% 36 1.94% main.allocateInitial
0 0% 99.89% 36 1.94% main.main
0 0% 99.89% 38 2.05% runtime.goexit
0 0% 99.89% 38 2.05% runtime.main
0 0% 99.89% 1820 97.95% runtime.rt0_go
0 0% 99.89% 1820 97.95% runtime.schedinit
$ wrk --latency -d 60s 'http://localhost:8080/debug/pprof/'
Running 1m test @ http://localhost:8080/debug/pprof/
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.52ms 11.08ms 197.07ms 98.20%
Req/Sec 21.82k 3.00k 26.49k 86.63%
Latency Distribution
50% 198.00us
75% 235.00us
90% 309.00us
99% 53.22ms
2600893 requests in 1.00m, 1.55GB read
Requests/sec: 43318.49
Transfer/sec: 26.48MB
http://goo.gl/jRIyGg
Debugging performance issues in Go programs
DmitryVyukov on May 10, 2014
MORE INFO
BUMPD
GC vs Developer
GO IS NOT C
• C is using pointers is C	

• Go is different, learned it the hard way	

• Often it is preferable to copy a little bit,
but avoid using pointers	

• We had to thoroughly inspect our code
and remove pointers everywhere we
could
$ go tool pprof --alloc_objects ./heaptest /tmp/…/mem.pprof
Adjusting heap profiles for 1-in-4096 sampling rate
Welcome to pprof! For help, type 'help'.
(pprof) top
Total: 29161720 objects
22648298 77.7% 77.7% 22648298 77.7% newselect
6513152 22.3% 100.0% 6513152 22.3% main.main
256 0.0% 100.0% 256 0.0% runtime.mallocinit
14 0.0% 100.0% 14 0.0% allocg
0 0.0% 100.0% 270 0.0% _rt0_go
0 0.0% 100.0% 22648298 77.7% main.loop
0 0.0% 100.0% 14 0.0% mcommoninit
NOT AN ALLOCATION
PROTOBUF
Very GC unfriendly library
$ cat test.proto
package test;
!
message TestMessage {
required uint32 user_id = 1;
optional string name = 2;
optional uint32 age = 3;
}
$ cat test.pb.go
package test
!
type TestMessage struct {
UserId *uint32
Name *string
Age *uint32
XXX_unrecognized []byte
}
GOGOPROTOBUF
https://github.com/gogo/protobuf
$ cat test.proto
package test;
!
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.goproto_unrecognized_all) = false;
!
message TestMessage {
required uint32 user_id = 1 [(gogoproto.nullable) = false];
optional string name = 2 [(gogoproto.nullable) = false];
optional uint32 age = 3 [(gogoproto.nullable) = false];
}
removes XXX_unrecognized	

(which is sometimes a bad thing)
removes field pointers	

(changes what optional means)
type TestMessage struct {
UserId uint32
Name string
Age uint32
}
PROTOBUF / MARSHALING
func SaveCoord(c Coord) error {
key := GetKey(c)
value, _ := proto.Marshal(&c)
return db.Put(key, value)
}
conversion to proto.Message	

(an interface)	

= escapes to heap	

= allocation
PROTOBUF
the default way
value []byte - allocated on heap
$ cat test.proto
package test;
!
import “github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.unsafe_marshaler_all) = true;
option (gogoproto.unsafe_unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
generates extra methods to speed up Marshal/Unmarshal	

+	

enables memory optimisation tricks	

!
but loses required field checks (to be fixed)
GOGOPROTOBUF
$ cat test.pb.go
!
func (m *Coord) MarshalTo(data []byte) (n int, err error)
func (m *Coord) Size() (n int)
func SaveCoord(c Coord) error {
key := GetKey(c)
data := make([]byte, c.Size())
n, _ := c.MarshalTo(data)
return db.Put(key, data[:n])
}
does not escape, allocated on stack
don’t forget to subslice :)
writes to stack buffer
CGO
Example 1
$ cat test.c
!
int get_error(char **error) {
*error = "error";
return 0;
}
$ cat test.go
[…skipped…]
!
func main() {
var errStr *C.char
C.get_error(&errStr)
s := C.GoString(errStr)
fmt.Println(s)
}
$ go build -gcflags=-m
# github.com/mkevac/test001
[…skipped…]
./test.go:13: moved to heap: errStr
./test.go:14: &errStr escapes to heap
./test.go:16: main ... argument does not escape
go 1.3.0
$ cat test.c
!
int get_error(char **error) {
*error = "error";
return 0;
}
$ cat test.go
[…skipped…]
!
func main() {
var errStr *C.char
C.get_error(&errStr)
s := C.GoString(errStr)
fmt.Println(s)
}
$ go build -gcflags=-m
# github.com/mkevac/test001
./test.go:14: main &errStr does not escape
./test.go:16: main ... argument does not escape
go 1.4.2
CGO
Example 2
db.Put() can cause data to escape!
func SaveCoord(c Coord) error {
key := GetKey(c)
value := make([]byte, c.Size())
n, _ := c.MarshalTo(value)
return db.Put(key, value[:n])
}
CGO
Example 3
Return struct from function instead of passing pointer to struct.
~2800 req/sec ~54 GiB in memory ~900 M objects
30 sec GC pause :-(	

~ 200 ms avg response ;-(
before optimisations
~2800 req/sec ~54 GiB in memory ~900 M objects
GC pause: 30s -> 3s // maps :-(	

avg response: 200ms -> 2ms // :-)
after optimisations
MAPS
type Person struct {
Name [6]byte // was string
Age uint
}
var People []Person // was []*Person
no pointers in struct
so GC treats this as a single object and does not “look inside”	

= fast GC
So we expect the same for map[k]v when k/v contain no pointers
MAPS
MAPS
var m = make(map[int]int)
!
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
!
for i := 0; i < 10000000; i++ {
m[i] = i
}
!
for {
runtime.GC()
time.Sleep(5 * time.Second)
}
}
GC Pause:	

500 ms
commit 85e7bee19f9f26dfca414b1e9054e429c448b14f
Author: Dmitry Vyukov <dvyukov@google.com>
Date: Mon Jan 26 21:04:41 2015 +0300
!
runtime: do not scan maps when k/v do not contain pointers
!
Currently we scan maps even if k/v does not contain pointers.
This is required because overflow buckets are hanging off the main table.
This change introduces a separate array that contains pointers to all
overflow buckets and keeps them alive. Buckets themselves are marked
as containing no pointers and are not scanned by GC (if k/v does not
contain pointers).
!
This brings maps in line with slices and chans -- GC does not scan
their contents if elements do not contain pointers.
!
Currently scanning of a map[int]int with 2e8 entries (~8GB heap)
takes ~8 seconds. With this change scanning takes negligible time.
!
Update #9477.
!
Change-Id: Id8a04066a53d2f743474cad406afb9f30f00eaae
Reviewed-on: https://go-review.googlesource.com/3288
Reviewed-by: Keith Randall <khr@golang.org>
expected in 1.5
https://github.com/golang/go/issues/9477
GOTIP
gc #11 @11.995s 0%: 0+0+0+0+3 ms clock, 0+0+0+0+25 ms
cpu, 304->304->304 MB, 8 P (forced)
GC SUMMARY & LINKS
• If you want to write low latency apps, you have to fight GC :-(	

• Debugging performance issues: http://goo.gl/jRIyGg	

• Go Escape Analysis Flaws: http://goo.gl/U1wkvy	

• Go execution tracer: http://goo.gl/KHLBQN	

• Interface type conversion: http://goo.gl/oJDYPa	

• GC debugcharts: https://github.com/mkevac/debugcharts	

• GC visualisation (davecheney): http://goo.gl/ubz5DL
Thank you.
Anton Povarov	

antoxa@corp.badoo.com
Marko Kevac	

m.kevac@corp.badoo.com

More Related Content

What's hot

Go破壊
Go破壊Go破壊
Go破壊
Hattori Hideo
 
(Fios#02) 2. elk 포렌식 분석
(Fios#02) 2. elk 포렌식 분석(Fios#02) 2. elk 포렌식 분석
(Fios#02) 2. elk 포렌식 분석
INSIGHT FORENSIC
 
Openstack taskflow 簡介
Openstack taskflow 簡介Openstack taskflow 簡介
Openstack taskflow 簡介
kao kuo-tung
 
LogStash - Yes, logging can be awesome
LogStash - Yes, logging can be awesomeLogStash - Yes, logging can be awesome
LogStash - Yes, logging can be awesome
James Turnbull
 
Kettunen, miaubiz fuzzing at scale and in style
Kettunen, miaubiz   fuzzing at scale and in styleKettunen, miaubiz   fuzzing at scale and in style
Kettunen, miaubiz fuzzing at scale and in styleDefconRussia
 
"Развитие ветки PHP-7"
"Развитие ветки PHP-7""Развитие ветки PHP-7"
"Развитие ветки PHP-7"
Badoo Development
 
{{more}} Kibana4
{{more}} Kibana4{{more}} Kibana4
{{more}} Kibana4
琛琳 饶
 
Odoo Performance Limits
Odoo Performance LimitsOdoo Performance Limits
Odoo Performance Limits
Odoo
 
Prometheus Storage
Prometheus StoragePrometheus Storage
Prometheus Storage
Fabian Reinartz
 
Nginx-lua
Nginx-luaNginx-lua
On Centralizing Logs
On Centralizing LogsOn Centralizing Logs
On Centralizing Logs
Sematext Group, Inc.
 
ELK stack at weibo.com
ELK stack at weibo.comELK stack at weibo.com
ELK stack at weibo.com
琛琳 饶
 
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Ontico
 
Monitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDBMonitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDB
Geoffrey Anderson
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
Toshiaki Baba
 
From zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchFrom zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and Elasticsearch
Rafał Kuć
 
Developing High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & GoDeveloping High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & Go
Chris Stivers
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
NAVER D2
 
[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화
NAVER D2
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
SmartLogic
 

What's hot (20)

Go破壊
Go破壊Go破壊
Go破壊
 
(Fios#02) 2. elk 포렌식 분석
(Fios#02) 2. elk 포렌식 분석(Fios#02) 2. elk 포렌식 분석
(Fios#02) 2. elk 포렌식 분석
 
Openstack taskflow 簡介
Openstack taskflow 簡介Openstack taskflow 簡介
Openstack taskflow 簡介
 
LogStash - Yes, logging can be awesome
LogStash - Yes, logging can be awesomeLogStash - Yes, logging can be awesome
LogStash - Yes, logging can be awesome
 
Kettunen, miaubiz fuzzing at scale and in style
Kettunen, miaubiz   fuzzing at scale and in styleKettunen, miaubiz   fuzzing at scale and in style
Kettunen, miaubiz fuzzing at scale and in style
 
"Развитие ветки PHP-7"
"Развитие ветки PHP-7""Развитие ветки PHP-7"
"Развитие ветки PHP-7"
 
{{more}} Kibana4
{{more}} Kibana4{{more}} Kibana4
{{more}} Kibana4
 
Odoo Performance Limits
Odoo Performance LimitsOdoo Performance Limits
Odoo Performance Limits
 
Prometheus Storage
Prometheus StoragePrometheus Storage
Prometheus Storage
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 
On Centralizing Logs
On Centralizing LogsOn Centralizing Logs
On Centralizing Logs
 
ELK stack at weibo.com
ELK stack at weibo.comELK stack at weibo.com
ELK stack at weibo.com
 
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
Tarantool как платформа для микросервисов / Антон Резников, Владимир Перепели...
 
Monitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDBMonitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDB
 
nouka inventry manager
nouka inventry managernouka inventry manager
nouka inventry manager
 
From zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchFrom zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and Elasticsearch
 
Developing High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & GoDeveloping High Performance Application with Aerospike & Go
Developing High Performance Application with Aerospike & Go
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화[232]TensorRT를 활용한 딥러닝 Inference 최적화
[232]TensorRT를 활용한 딥러닝 Inference 최적화
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
 

Viewers also liked

Go meetup 2015 04-23
Go meetup 2015 04-23Go meetup 2015 04-23
Go meetup 2015 04-23
Maxim Dementyev
 
Go meetup smotri+ 23.04.2015
Go meetup smotri+ 23.04.2015Go meetup smotri+ 23.04.2015
Go meetup smotri+ 23.04.2015
Mikhail Salosin
 
Sweating the UX Details
Sweating the UX DetailsSweating the UX Details
Sweating the UX Details
Stephen Anderson
 
(Не)безопасный frontend
(Не)безопасный frontend(Не)безопасный frontend
(Не)безопасный frontend
Sergey Belov
 
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Kate Rutter
 
Digital Sketchnotes 101
Digital Sketchnotes 101Digital Sketchnotes 101
Digital Sketchnotes 101
Karen Bosch
 
Sketchnote Mini-Workshop: DSGNDAY 2014
Sketchnote Mini-Workshop: DSGNDAY 2014Sketchnote Mini-Workshop: DSGNDAY 2014
Sketchnote Mini-Workshop: DSGNDAY 2014
Mike Rohde
 
«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)
«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)
«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)
AvitoTech
 
Golang в avito
Golang в avitoGolang в avito
Golang в avito
AvitoTech
 
«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)
«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)
«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)
AvitoTech
 
как работают яндекс.пробки
как работают яндекс.пробкикак работают яндекс.пробки
как работают яндекс.пробкиYandex
 
Yandex20131017 ageev-2
Yandex20131017 ageev-2Yandex20131017 ageev-2
Yandex20131017 ageev-2
Yandex
 
Yandex1
Yandex1Yandex1
Yandex1
Yandex
 
Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...
Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...
Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...Yandex
 
Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...
Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...
Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...
Badoo Development
 
Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...
Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...
Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...
Badoo Development
 
Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"
Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"
Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"
Badoo Development
 
Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...
Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...
Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...
Badoo Development
 
Deviantart presentation final
Deviantart presentation finalDeviantart presentation final
Deviantart presentation final
MAdams93
 

Viewers also liked (20)

Go meetup 2015 04-23
Go meetup 2015 04-23Go meetup 2015 04-23
Go meetup 2015 04-23
 
Go meetup smotri+ 23.04.2015
Go meetup smotri+ 23.04.2015Go meetup smotri+ 23.04.2015
Go meetup smotri+ 23.04.2015
 
Sweating the UX Details
Sweating the UX DetailsSweating the UX Details
Sweating the UX Details
 
(Не)безопасный frontend
(Не)безопасный frontend(Не)безопасный frontend
(Не)безопасный frontend
 
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
 
Digital Sketchnotes 101
Digital Sketchnotes 101Digital Sketchnotes 101
Digital Sketchnotes 101
 
Sketchnote Mini-Workshop: DSGNDAY 2014
Sketchnote Mini-Workshop: DSGNDAY 2014Sketchnote Mini-Workshop: DSGNDAY 2014
Sketchnote Mini-Workshop: DSGNDAY 2014
 
«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)
«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)
«Миллион открытых каналов с данными по сети» – Илья Биин (Zenhotels)
 
Golang в avito
Golang в avitoGolang в avito
Golang в avito
 
«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)
«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)
«Как 200 строк на Go помогли нам освободить 15 серверов» – Паша Мурзаков (Badoo)
 
как работают яндекс.пробки
как работают яндекс.пробкикак работают яндекс.пробки
как работают яндекс.пробки
 
Yandex20131017 ageev-2
Yandex20131017 ageev-2Yandex20131017 ageev-2
Yandex20131017 ageev-2
 
Yandex1
Yandex1Yandex1
Yandex1
 
Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...
Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...
Максим Мусин - Умные компьютеры, как это работает, где этому научиться и когд...
 
Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...
Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...
Доклад "Специфика верстки мультиязычных веб-приложений в Badoo" на MoscowJS M...
 
Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...
Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...
Доклад Ильи Кудинова на конференции LoveQA. "Как мы разгоняли тесты — от баш-...
 
Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"
Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"
Доклад Анатолия Панова на конференции РИТ++ 2014. "Биллинг в большом проекте"
 
Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...
Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...
Доклад Александра Хози и Николая Козлова на конференции LoveQA. "Есть ли жизн...
 
Deviantart presentation final
Deviantart presentation finalDeviantart presentation final
Deviantart presentation final
 
Presentación de periscope
Presentación de periscopePresentación de periscope
Presentación de periscope
 

Similar to Доклад Антона Поварова "Go in Badoo" с Golang Meetup

CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
PROIDEA
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
Tzung-Bi Shih
 
Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#
Paulo Morgado
 
NetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf EditionNetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf Edition
Paulo Morgado
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
Dongmin Yu
 
GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
Sebastian Pożoga
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Yauheni Akhotnikau
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
Emanuel Calvo
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
NAVER D2
 
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨
flyinweb
 
Megadata With Python and Hadoop
Megadata With Python and HadoopMegadata With Python and Hadoop
Megadata With Python and Hadoop
ryancox
 
Explain this!
Explain this!Explain this!
Explain this!
Fabio Telles Rodriguez
 
PythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummiesPythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummies
Tatiana Al-Chueyr
 
Naughty And Nice Bash Features
Naughty And Nice Bash FeaturesNaughty And Nice Bash Features
Naughty And Nice Bash Features
Nati Cohen
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtime
Andrea Cardinale
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!
François-Guillaume Ribreau
 
2015-GopherCon-Talk-Uptime.pdf
2015-GopherCon-Talk-Uptime.pdf2015-GopherCon-Talk-Uptime.pdf
2015-GopherCon-Talk-Uptime.pdf
UtabeUtabe
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
Doug Hawkins
 
Beyond Parallelize and Collect by Holden Karau
Beyond Parallelize and Collect by Holden KarauBeyond Parallelize and Collect by Holden Karau
Beyond Parallelize and Collect by Holden Karau
Spark Summit
 

Similar to Доклад Антона Поварова "Go in Badoo" с Golang Meetup (20)

CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
 
Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#
 
NetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf EditionNetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf Edition
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
 
GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
 
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
 
Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨Nodejs性能分析优化和分布式设计探讨
Nodejs性能分析优化和分布式设计探讨
 
Megadata With Python and Hadoop
Megadata With Python and HadoopMegadata With Python and Hadoop
Megadata With Python and Hadoop
 
Explain this!
Explain this!Explain this!
Explain this!
 
PythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummiesPythonBrasil[8] - CPython for dummies
PythonBrasil[8] - CPython for dummies
 
Naughty And Nice Bash Features
Naughty And Nice Bash FeaturesNaughty And Nice Bash Features
Naughty And Nice Bash Features
 
Czzawk
CzzawkCzzawk
Czzawk
 
Logstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtimeLogstash for SEO: come monitorare i Log del Web Server in realtime
Logstash for SEO: come monitorare i Log del Web Server in realtime
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!
 
2015-GopherCon-Talk-Uptime.pdf
2015-GopherCon-Talk-Uptime.pdf2015-GopherCon-Talk-Uptime.pdf
2015-GopherCon-Talk-Uptime.pdf
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 
Beyond Parallelize and Collect by Holden Karau
Beyond Parallelize and Collect by Holden KarauBeyond Parallelize and Collect by Holden Karau
Beyond Parallelize and Collect by Holden Karau
 

More from Badoo Development

Viktar Karanevich – iOS Parallel Automation
Viktar Karanevich – iOS Parallel AutomationViktar Karanevich – iOS Parallel Automation
Viktar Karanevich – iOS Parallel Automation
Badoo Development
 
Как мы делаем модули PHP в Badoo – Антон Довгаль
Как мы делаем модули PHP в Badoo – Антон ДовгальКак мы делаем модули PHP в Badoo – Антон Довгаль
Как мы делаем модули PHP в Badoo – Антон Довгаль
Badoo Development
 
Григорий Джанелидзе, OK.RU
Григорий Джанелидзе, OK.RUГригорий Джанелидзе, OK.RU
Григорий Джанелидзе, OK.RU
Badoo Development
 
Андрей Сидоров, Яндекс.Браузер
Андрей Сидоров, Яндекс.БраузерАндрей Сидоров, Яндекс.Браузер
Андрей Сидоров, Яндекс.Браузер
Badoo Development
 
Филипп Уваров, Avito
Филипп Уваров, AvitoФилипп Уваров, Avito
Филипп Уваров, Avito
Badoo Development
 
Cocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magicCocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magic
Badoo Development
 
Cocoaheads Meetup / Kateryna Trofimenko / Feature development
Cocoaheads Meetup / Kateryna Trofimenko / Feature developmentCocoaheads Meetup / Kateryna Trofimenko / Feature development
Cocoaheads Meetup / Kateryna Trofimenko / Feature development
Badoo Development
 
Alex Krasheninnikov – Hadoop High Availability
Alex Krasheninnikov – Hadoop High AvailabilityAlex Krasheninnikov – Hadoop High Availability
Alex Krasheninnikov – Hadoop High Availability
Badoo Development
 
Андрей Денисов – В ожидании мониторинга баз данных
Андрей Денисов – В ожидании мониторинга баз данныхАндрей Денисов – В ожидании мониторинга баз данных
Андрей Денисов – В ожидании мониторинга баз данных
Badoo Development
 
Александр Зобнин, Grafana Labs
Александр Зобнин, Grafana LabsАлександр Зобнин, Grafana Labs
Александр Зобнин, Grafana Labs
Badoo Development
 
Илья Аблеев – Zabbix в Badoo: реагируем быстро и качественно
Илья Аблеев – Zabbix в Badoo: реагируем быстро и качественноИлья Аблеев – Zabbix в Badoo: реагируем быстро и качественно
Илья Аблеев – Zabbix в Badoo: реагируем быстро и качественно
Badoo Development
 
TechLeads meetup: Андрей Шелёхин, Tinkoff.ru
TechLeads meetup: Андрей Шелёхин, Tinkoff.ruTechLeads meetup: Андрей Шелёхин, Tinkoff.ru
TechLeads meetup: Андрей Шелёхин, Tinkoff.ru
Badoo Development
 
TechLeads meetup: Алексей Рыбак, Badoo
TechLeads meetup: Алексей Рыбак, BadooTechLeads meetup: Алексей Рыбак, Badoo
TechLeads meetup: Алексей Рыбак, Badoo
Badoo Development
 
TechLeads meetup: Евгений Потапов, ITSumma
TechLeads meetup: Евгений Потапов, ITSumma TechLeads meetup: Евгений Потапов, ITSumma
TechLeads meetup: Евгений Потапов, ITSumma
Badoo Development
 
TechLeads meetup: Макс Лапшин, Erlyvideo
TechLeads meetup: Макс Лапшин, ErlyvideoTechLeads meetup: Макс Лапшин, Erlyvideo
TechLeads meetup: Макс Лапшин, Erlyvideo
Badoo Development
 
Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»
Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»  Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»
Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»
Badoo Development
 
Как мы готовим MySQL
 Как мы готовим MySQL  Как мы готовим MySQL
Как мы готовим MySQL
Badoo Development
 
Архитектура хранения и отдачи фотографий в Badoo
Архитектура хранения и отдачи фотографий в Badoo Архитектура хранения и отдачи фотографий в Badoo
Архитектура хранения и отдачи фотографий в Badoo
Badoo Development
 
5 способов деплоя PHP-кода в условиях хайлоада
5 способов деплоя PHP-кода в условиях хайлоада5 способов деплоя PHP-кода в условиях хайлоада
5 способов деплоя PHP-кода в условиях хайлоада
Badoo Development
 
ChromeDriver Jailbreak
ChromeDriver JailbreakChromeDriver Jailbreak
ChromeDriver Jailbreak
Badoo Development
 

More from Badoo Development (20)

Viktar Karanevich – iOS Parallel Automation
Viktar Karanevich – iOS Parallel AutomationViktar Karanevich – iOS Parallel Automation
Viktar Karanevich – iOS Parallel Automation
 
Как мы делаем модули PHP в Badoo – Антон Довгаль
Как мы делаем модули PHP в Badoo – Антон ДовгальКак мы делаем модули PHP в Badoo – Антон Довгаль
Как мы делаем модули PHP в Badoo – Антон Довгаль
 
Григорий Джанелидзе, OK.RU
Григорий Джанелидзе, OK.RUГригорий Джанелидзе, OK.RU
Григорий Джанелидзе, OK.RU
 
Андрей Сидоров, Яндекс.Браузер
Андрей Сидоров, Яндекс.БраузерАндрей Сидоров, Яндекс.Браузер
Андрей Сидоров, Яндекс.Браузер
 
Филипп Уваров, Avito
Филипп Уваров, AvitoФилипп Уваров, Avito
Филипп Уваров, Avito
 
Cocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magicCocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magic
 
Cocoaheads Meetup / Kateryna Trofimenko / Feature development
Cocoaheads Meetup / Kateryna Trofimenko / Feature developmentCocoaheads Meetup / Kateryna Trofimenko / Feature development
Cocoaheads Meetup / Kateryna Trofimenko / Feature development
 
Alex Krasheninnikov – Hadoop High Availability
Alex Krasheninnikov – Hadoop High AvailabilityAlex Krasheninnikov – Hadoop High Availability
Alex Krasheninnikov – Hadoop High Availability
 
Андрей Денисов – В ожидании мониторинга баз данных
Андрей Денисов – В ожидании мониторинга баз данныхАндрей Денисов – В ожидании мониторинга баз данных
Андрей Денисов – В ожидании мониторинга баз данных
 
Александр Зобнин, Grafana Labs
Александр Зобнин, Grafana LabsАлександр Зобнин, Grafana Labs
Александр Зобнин, Grafana Labs
 
Илья Аблеев – Zabbix в Badoo: реагируем быстро и качественно
Илья Аблеев – Zabbix в Badoo: реагируем быстро и качественноИлья Аблеев – Zabbix в Badoo: реагируем быстро и качественно
Илья Аблеев – Zabbix в Badoo: реагируем быстро и качественно
 
TechLeads meetup: Андрей Шелёхин, Tinkoff.ru
TechLeads meetup: Андрей Шелёхин, Tinkoff.ruTechLeads meetup: Андрей Шелёхин, Tinkoff.ru
TechLeads meetup: Андрей Шелёхин, Tinkoff.ru
 
TechLeads meetup: Алексей Рыбак, Badoo
TechLeads meetup: Алексей Рыбак, BadooTechLeads meetup: Алексей Рыбак, Badoo
TechLeads meetup: Алексей Рыбак, Badoo
 
TechLeads meetup: Евгений Потапов, ITSumma
TechLeads meetup: Евгений Потапов, ITSumma TechLeads meetup: Евгений Потапов, ITSumma
TechLeads meetup: Евгений Потапов, ITSumma
 
TechLeads meetup: Макс Лапшин, Erlyvideo
TechLeads meetup: Макс Лапшин, ErlyvideoTechLeads meetup: Макс Лапшин, Erlyvideo
TechLeads meetup: Макс Лапшин, Erlyvideo
 
Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»
Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»  Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»
Паша Мурзаков: Как 200 строк на Go помогли нам освободить 15 серверов»
 
Как мы готовим MySQL
 Как мы готовим MySQL  Как мы готовим MySQL
Как мы готовим MySQL
 
Архитектура хранения и отдачи фотографий в Badoo
Архитектура хранения и отдачи фотографий в Badoo Архитектура хранения и отдачи фотографий в Badoo
Архитектура хранения и отдачи фотографий в Badoo
 
5 способов деплоя PHP-кода в условиях хайлоада
5 способов деплоя PHP-кода в условиях хайлоада5 способов деплоя PHP-кода в условиях хайлоада
5 способов деплоя PHP-кода в условиях хайлоада
 
ChromeDriver Jailbreak
ChromeDriver JailbreakChromeDriver Jailbreak
ChromeDriver Jailbreak
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Доклад Антона Поварова "Go in Badoo" с Golang Meetup

  • 1. GO IN BADOO Go meetup April 2015 Anton Povarov antoxa@corp.badoo.com Marko Kevac m.kevac@corp.badoo.com
  • 2. BADOO BACKEND IN 2013 • PHP • C/C++ (~25 home-made daemons) • Python
  • 3. BADOO BACKEND IN 2014 • PHP • C/C++ (~25 home-made daemons) • Python • Go
  • 5. INFRASTRUCTURE • Same config, same logging, same directory structure • Same protocol, including JSON to Protobuf conversion • Build and testing inTeamCity • QA team should not know this is a Go project Go is not special in any way
  • 6. INFRASTRUCTURE • Logs go to syslog and eventually to Splunk • Metrics are collected with home-grown system based on RRD (you will see some examples) • HTTP based profiling is always on
  • 7. INFRASTRUCTURE • As of now we do not use vendoring • We use go get for dependencies • Sometimes we just fork projects (as with rocksdb lib) • We use Make for building
  • 8. BUMPED when two people meet somewhere in the world
  • 9. BUMPED • Done in a week • By three people • Huge win for product
  • 12. ~2800 req/sec ~54 GiB in memory ~900 M objects
  • 13. ~2800 req/sec ~54 GiB in memory ~900 M objects 30 sec GC pause :-( ~ 200 ms avg response ;-(
  • 15. DO NOT GIVE UP for { generateSomeLoad() go tool pprof -alloc_objects http://.../debug/pprof/heap go tool pprof -inuse_objects http://.../debug/pprof/heap think() go build -gcflags=-m foobar.go thinkAndFix() }
  • 17. MEMORY PROFILING CRASH COURSE Allocating on stack ! • Fast • No GC pressure • Stack size is not fixed in Go • Not always possible Allocating on heap ! • Slower • GC pressure • Always possible
  • 18. type Person struct { Name string Age uint } var People []*Person const PeopleCount = 10000000 func allocateInitial() { ... func allocateMore() { ... ! ! func main() { runtime.GOMAXPROCS(runtime.NumCPU()) allocateInitial() go allocateMore() http.ListenAndServe("localhost:8080", nil) } MEMORY PROFILING CRASH COURSE
  • 19. func allocateMore() { for { for i := 0; i < PeopleCount; i++ { People = append(People, &Person{"marko", 29}) } People = People[0:PeopleCount] time.Sleep(10 * time.Second) } } func allocateInitial() { for i := 0; i < PeopleCount; i++ { People = append(People, &Person{"marko", 29}) } } MEMORY PROFILING CRASH COURSE
  • 20. ESCAPE ANALYSIS $ go build -gcflags=-m # github.com/mkevac/test002 ./test.go:20: &Person literal escapes to heap ./test.go:27: &Person literal escapes to heap
  • 21. $ go tool pprof —inuse_objects ./test002 http://.../debug/pprof/heap (pprof) top10 10617157 of 10618977 total ( 100%) Dropped 3 nodes (cum <= 53094) flat flat% sum% cum cum% 9945392 93.66% 93.66% 9945392 93.66% main.allocateInitial 671765 6.33% 100% 671765 6.33% main.allocateMore 0 0% 100% 9945392 93.66% main.main 0 0% 100% 10617157 100% runtime.goexit 0 0% 100% 9945392 93.66% runtime.main ALLOCATIONS
  • 22. (pprof) list main.allocateInitial Total: 10618977 ROUTINE ======================== main.allocateInitial in /Users/marko/goprojects/src/ github.com/mkevac/test002/test.go 9945392 9945392 (flat, cum) 93.66% of Total . . 15: . . 16:const PeopleCount = 10000000 . . 17: . . 18:func allocateInitial() { . . 19: for i := 0; i < PeopleCount; i++ { 9945392 9945392 20: People = append(People, &Person{"marko", 29}) . . 21: } . . 22:} . . 23: . . 24:func allocateMore() { . . 25: for { ALLOCATIONS
  • 24. $ go tool pprof —alloc_objects ./test002 http://.../debug/pprof/heap (pprof) top10 191993610 of 191995430 total ( 100%) Dropped 3 nodes (cum <= 959977) flat flat% sum% cum cum% 182048182 94.82% 94.82% 182048182 94.82% main.allocateMore 9945428 5.18% 100% 9945428 5.18% main.allocateInitial 0 0% 100% 9945428 5.18% main.main 0 0% 100% 191993610 100% runtime.goexit 0 0% 100% 9945428 5.18% runtime.main
  • 25. http://localhost:8080/debug/pprof/heap?debug=1 # NextGC = 1619939888 # PauseNs = [144830 87026 98881 2162680 2990228 3759763 6233690 11810930 18442986 34012539 47019926 72834183 114591578 178384506 315007729 480245709 568020053 575784519 517883227 518861595 604910252 514458210 542329937 560007420 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] # NumGC = 24 GC pause: ~500 ms
  • 26. $ GODEBUG=gctrace=1 ./test002 gc16(1): 1+16+433413+1 us, 396 -> 793 MB, 15766167 (15766492-325) objects, 8 goroutines, 61633/1/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields read more: http://goo.gl/jRIyGg
  • 27. gc16(1): // 16th GC (1 thread was doing it) ! 1+16+433413+1 us, // GC prepare + sweep + mark + finalise ! 396 -> 793 MB, // heap grew from X to Y since last GC ! 15766167 (15766492-325) objects, // 15766167 objects in heap (incl. garbage) // 15766492 allocs - 325 frees ! 8 goroutines, 61633/1/0 sweeps, // 61633 total spans, 1 in bg, 0 in pause ! 0(0) handoff, 0(0) steal, 0/0/0 yields // some scheduling stats :) read more: http://goo.gl/jRIyGg
  • 28. $ wrk --latency -d 60s 'http://localhost:8080/debug/pprof/' Running 1m test @ http://localhost:8080/debug/pprof/ 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 26.37ms 100.32ms 751.54ms 93.65% Req/Sec 7.56k 2.47k 9.56k 89.05% Latency Distribution 50% 687.00us 75% 1.02ms 90% 11.59ms 99% 550.23ms 831369 requests in 1.00m, 507.43MB read Requests/sec: 13848.63 Transfer/sec: 8.45MB
  • 29. DEBUGCHARTS • Memory Allocated • GC Pauses • Shows data for last 24h https://github.com/mkevac/debugcharts
  • 31. MEMORY PROFILING CRASH COURSE (FIXED) type Person struct { Name [6]byte // was string Age uint } var People []Person // was []*Person const PeopleCount = 10000000 func allocateMore() { for { for i := 0; i < PeopleCount; i++ { People = append(People, Person{[6]byte{'m', 'a', 'r', 'k', 'o', 0}, 29}) } People = People[0:PeopleCount] time.Sleep(10 * time.Second) } }
  • 32. $ go tool pprof —inuse_objects ./test003 http:/…/debug/pprof/heap (pprof) top10 1820 of 1824 total (99.78%) Dropped 8 nodes (cum <= 9) flat flat% sum% cum cum% 1820 99.78% 99.78% 1820 99.78% mcommoninit 0 0% 99.78% 1820 99.78% runtime.rt0_go 0 0% 99.78% 1820 99.78% runtime.schedinit
  • 33. $ go tool pprof —alloc_objects ./test003 http://.../debug/pprof/heap (pprof) top10 1856 of 1858 total (99.89%) Dropped 4 nodes (cum <= 9) flat flat% sum% cum cum% 1820 97.95% 97.95% 1820 97.95% mcommoninit 36 1.94% 99.89% 36 1.94% main.allocateInitial 0 0% 99.89% 36 1.94% main.main 0 0% 99.89% 38 2.05% runtime.goexit 0 0% 99.89% 38 2.05% runtime.main 0 0% 99.89% 1820 97.95% runtime.rt0_go 0 0% 99.89% 1820 97.95% runtime.schedinit
  • 34. $ wrk --latency -d 60s 'http://localhost:8080/debug/pprof/' Running 1m test @ http://localhost:8080/debug/pprof/ 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 1.52ms 11.08ms 197.07ms 98.20% Req/Sec 21.82k 3.00k 26.49k 86.63% Latency Distribution 50% 198.00us 75% 235.00us 90% 309.00us 99% 53.22ms 2600893 requests in 1.00m, 1.55GB read Requests/sec: 43318.49 Transfer/sec: 26.48MB
  • 35. http://goo.gl/jRIyGg Debugging performance issues in Go programs DmitryVyukov on May 10, 2014 MORE INFO
  • 37. GO IS NOT C • C is using pointers is C • Go is different, learned it the hard way • Often it is preferable to copy a little bit, but avoid using pointers • We had to thoroughly inspect our code and remove pointers everywhere we could
  • 38. $ go tool pprof --alloc_objects ./heaptest /tmp/…/mem.pprof Adjusting heap profiles for 1-in-4096 sampling rate Welcome to pprof! For help, type 'help'. (pprof) top Total: 29161720 objects 22648298 77.7% 77.7% 22648298 77.7% newselect 6513152 22.3% 100.0% 6513152 22.3% main.main 256 0.0% 100.0% 256 0.0% runtime.mallocinit 14 0.0% 100.0% 14 0.0% allocg 0 0.0% 100.0% 270 0.0% _rt0_go 0 0.0% 100.0% 22648298 77.7% main.loop 0 0.0% 100.0% 14 0.0% mcommoninit NOT AN ALLOCATION
  • 40. $ cat test.proto package test; ! message TestMessage { required uint32 user_id = 1; optional string name = 2; optional uint32 age = 3; } $ cat test.pb.go package test ! type TestMessage struct { UserId *uint32 Name *string Age *uint32 XXX_unrecognized []byte }
  • 42. $ cat test.proto package test; ! import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.goproto_unrecognized_all) = false; ! message TestMessage { required uint32 user_id = 1 [(gogoproto.nullable) = false]; optional string name = 2 [(gogoproto.nullable) = false]; optional uint32 age = 3 [(gogoproto.nullable) = false]; } removes XXX_unrecognized (which is sometimes a bad thing) removes field pointers (changes what optional means)
  • 43. type TestMessage struct { UserId uint32 Name string Age uint32 }
  • 45. func SaveCoord(c Coord) error { key := GetKey(c) value, _ := proto.Marshal(&c) return db.Put(key, value) } conversion to proto.Message (an interface) = escapes to heap = allocation PROTOBUF the default way value []byte - allocated on heap
  • 46. $ cat test.proto package test; ! import “github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.unsafe_marshaler_all) = true; option (gogoproto.unsafe_unmarshaler_all) = true; option (gogoproto.sizer_all) = true; generates extra methods to speed up Marshal/Unmarshal + enables memory optimisation tricks ! but loses required field checks (to be fixed) GOGOPROTOBUF
  • 47. $ cat test.pb.go ! func (m *Coord) MarshalTo(data []byte) (n int, err error) func (m *Coord) Size() (n int) func SaveCoord(c Coord) error { key := GetKey(c) data := make([]byte, c.Size()) n, _ := c.MarshalTo(data) return db.Put(key, data[:n]) } does not escape, allocated on stack don’t forget to subslice :) writes to stack buffer
  • 49. $ cat test.c ! int get_error(char **error) { *error = "error"; return 0; } $ cat test.go […skipped…] ! func main() { var errStr *C.char C.get_error(&errStr) s := C.GoString(errStr) fmt.Println(s) } $ go build -gcflags=-m # github.com/mkevac/test001 […skipped…] ./test.go:13: moved to heap: errStr ./test.go:14: &errStr escapes to heap ./test.go:16: main ... argument does not escape go 1.3.0
  • 50. $ cat test.c ! int get_error(char **error) { *error = "error"; return 0; } $ cat test.go […skipped…] ! func main() { var errStr *C.char C.get_error(&errStr) s := C.GoString(errStr) fmt.Println(s) } $ go build -gcflags=-m # github.com/mkevac/test001 ./test.go:14: main &errStr does not escape ./test.go:16: main ... argument does not escape go 1.4.2
  • 52. db.Put() can cause data to escape! func SaveCoord(c Coord) error { key := GetKey(c) value := make([]byte, c.Size()) n, _ := c.MarshalTo(value) return db.Put(key, value[:n]) }
  • 53.
  • 55. Return struct from function instead of passing pointer to struct.
  • 56. ~2800 req/sec ~54 GiB in memory ~900 M objects 30 sec GC pause :-( ~ 200 ms avg response ;-( before optimisations
  • 57. ~2800 req/sec ~54 GiB in memory ~900 M objects GC pause: 30s -> 3s // maps :-( avg response: 200ms -> 2ms // :-) after optimisations
  • 58. MAPS
  • 59. type Person struct { Name [6]byte // was string Age uint } var People []Person // was []*Person no pointers in struct so GC treats this as a single object and does not “look inside” = fast GC So we expect the same for map[k]v when k/v contain no pointers MAPS
  • 60. MAPS var m = make(map[int]int) ! func main() { runtime.GOMAXPROCS(runtime.NumCPU()) ! for i := 0; i < 10000000; i++ { m[i] = i } ! for { runtime.GC() time.Sleep(5 * time.Second) } } GC Pause: 500 ms
  • 61. commit 85e7bee19f9f26dfca414b1e9054e429c448b14f Author: Dmitry Vyukov <dvyukov@google.com> Date: Mon Jan 26 21:04:41 2015 +0300 ! runtime: do not scan maps when k/v do not contain pointers ! Currently we scan maps even if k/v does not contain pointers. This is required because overflow buckets are hanging off the main table. This change introduces a separate array that contains pointers to all overflow buckets and keeps them alive. Buckets themselves are marked as containing no pointers and are not scanned by GC (if k/v does not contain pointers). ! This brings maps in line with slices and chans -- GC does not scan their contents if elements do not contain pointers. ! Currently scanning of a map[int]int with 2e8 entries (~8GB heap) takes ~8 seconds. With this change scanning takes negligible time. ! Update #9477. ! Change-Id: Id8a04066a53d2f743474cad406afb9f30f00eaae Reviewed-on: https://go-review.googlesource.com/3288 Reviewed-by: Keith Randall <khr@golang.org> expected in 1.5 https://github.com/golang/go/issues/9477
  • 62. GOTIP gc #11 @11.995s 0%: 0+0+0+0+3 ms clock, 0+0+0+0+25 ms cpu, 304->304->304 MB, 8 P (forced)
  • 63. GC SUMMARY & LINKS • If you want to write low latency apps, you have to fight GC :-( • Debugging performance issues: http://goo.gl/jRIyGg • Go Escape Analysis Flaws: http://goo.gl/U1wkvy • Go execution tracer: http://goo.gl/KHLBQN • Interface type conversion: http://goo.gl/oJDYPa • GC debugcharts: https://github.com/mkevac/debugcharts • GC visualisation (davecheney): http://goo.gl/ubz5DL