Skip to content

Instantly share code, notes, and snippets.

OSX i7-3720QM CPU @ 2.60GHz go1.2 darwin/amd64

Performance doesn't increase with GOMAXPROCS it gets worse on OSX!

GOMAXPROCS=1
./websocket_client 1 100000
Sent 400000 in 2.389414969s for a rate of 167404/second

GOMAXPROCS=2
./websocket_client 2 100000

Sent 400000 in 6.219798526s for a rate of 64310/second <-- Lost 100K msgs/second!

package main
import (
"github.com/alecthomas/gozmq"
"fmt"
)
type ClientAgent interface {
ListenAndServe()
Close()

Index using 31.1 bits per integer
Index decoded integers at 775,401,965/sec in 645ms
Compressed bitmap sets at 680,639,707/sec in 735ms
Compressed bitmap using 536,558,060 bytes for 471,997,769 bits set
471,997,769 actual records

Index using 31.1 bits per integer
Index decoded integers at 569,875,343/sec in 877ms
Compressed bitmap sets at 814,863,270/sec in 614ms
Compressed bitmap using 536,558,364 bytes for 472,003,763 bits set

@kellabyte
kellabyte / dstat_csv_output.txt
Last active December 28, 2015 08:09
dstat csv output
dstat -tcmrd --disk-util -ny --output metrics.csv
"system","total cpu usage",,,,,,"memory usage",,,,"io/total",,"dsk/total",,"sda","sdb","sdc","net/total",,"system",
"date/time","usr","sys","idl","wai","hiq","siq","used","buff","cach","free","read","writ","read","writ","util","util","util","recv","send","int","csw"
13-11 15:39:48,14.670,0.850,51.739,32.718,0.0,0.022,5024739328.0,21512192.0,11012661248.0,804286464.0,152.400,3.885,13525800.545,36477.273,2.973,60.063,0.008,0.0,0.0,659.300,621.473
13-11 15:39:49,0.0,0.0,100.0,0.0,0.0,0.0,5024735232.0,21512192.0,11012665344.0,804286464.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1194.0,2830.0,162.0,239.0
13-11 15:39:50,0.500,0.0,99.500,0.0,0.0,0.0,5024735232.0,21512192.0,11012665344.0,804286464.0,0.0,6.0,0.0,24576.0,0.0,0.0,0.0,864.0,1530.0,145.0,228.0
13-11 15:39:51,0.500,0.0,99.500,0.0,0.0,0.0,5024735232.0,21512192.0,11012665344.0,804286464.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,760.0,1513.0,151.0,218.0
runtime.mach_semaphore_wait()
/usr/local/go/src/pkg/runtime/sys_darwin_amd64.s:395 +0xb
runtime.semasleep(0xffffffffffffffff)
/usr/local/go/src/pkg/runtime/os_darwin.c:414 +0xa1
runtime.notesleep(0x4697130)
/usr/local/go/src/pkg/runtime/lock_sema.c:164 +0xc7
stopm()
/usr/local/go/src/pkg/runtime/proc.c:927 +0xe1
findrunnable()
/usr/local/go/src/pkg/runtime/proc.c:1232 +0x42d
{
"type": "tx",
"ops": [
{
"op": "set",
"ks": "users",
"k": "1234",
"v": "asmith"
},
{
package libdazzle
import (
"fmt"
"net/http"
"strconv"
"time"
)
type HttpServer struct {
package dazzle
import (
"fmt"
)
func main() {
fmt.Println("Hello world")
}

New code results

New code results

for i in {1..6}; do ./wrk -d10s -t24 -c24 --latency --pipeline 512 http://server:8000; done
Running 10s test @ http://server:8000
  24 threads and 24 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    27.11ms   20.35ms 285.64ms   85.02%

Req/Sec 25.04k 11.73k 74.74k 63.48%

26.10% haywire_hello_w libc-2.17.so [.] 0x000000000008109e
11.82% haywire_hello_w haywire_hello_world [.] http_parser_execute
4.91% haywire_hello_w libc-2.17.so [.] malloc
4.38% haywire_hello_w [kernel.kallsyms] [k] native_read_msr_safe
4.31% haywire_hello_w [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore
3.37% haywire_hello_w haywire_hello_world [.] http_request_on_header_field
2.31% haywire_hello_w haywire_hello_world [.] hw_route_compare_method
1.96% haywire_hello_w [kernel.kallsyms] [k] tcp_sendmsg
1.72% haywire_hello_w libc-2.17.so [.] __libc_calloc
1.30% haywire_hello_w [kernel.kallsyms] [k] default_send_IPI_mask_sequence_phys