Skip to content

Instantly share code, notes, and snippets.

@tivvit
tivvit / aerospike_forking.py
Created August 24, 2015 08:37
Correct usage of python aerospike client in forked server
#!/usr/bin/python2
import random
import aerospike
import os, sys
cli = aerospike.client(
{
"hosts": [("aeros4", 3000), ("aeros1", 3000), ("aeros2", 3000), ("aeros3", 3000)],
"policies": {
@tivvit
tivvit / as_fork_query_stuck.py
Created September 11, 2015 11:13
Aerospike query stuck after fork
import time
import aerospike
import os
client = aerospike.client({
'lua': {},
'hosts': [('aeros.dev', 3000)],
'shm': {'takeover_threshold_sec': 30},
'policies': {'timeout': 3000}
})
@tivvit
tivvit / aerospike.log
Created March 2, 2016 14:18
aerospike.log
Feb 29 2016 16:46:12 GMT: INFO (drv_ssd): (drv_ssd.c::2088) device /opt/aerospike/data/aero_scan.dat: used 9452474112, contig-free 108482M (108482 wblocks), swb-free 3, w-q 0 w-tot 3087071 (6.0/s), defrag-q 0 defrag-tot 3076023 (5.5/s) defrag-w-tot 1510103 (2.8/s)
Feb 29 2016 16:46:20 GMT: INFO (info): (thr_info.c::4979) system memory: free 99016156kb ( 99 percent free )
Feb 29 2016 16:46:20 GMT: INFO (info): (thr_info.c::4985) ClusterSize 20 ::: objects 13131801 ::: sub_objects 0
Feb 29 2016 16:46:20 GMT: INFO (info): (thr_info.c::4994) rec refs 13131801 ::: rec locks 0 ::: trees 0 ::: wr reqs 1 ::: mig tx 0 ::: mig rx 0
Feb 29 2016 16:46:20 GMT: INFO (info): (thr_info.c::4999) replica errs :: null 0 non-null 0 ::: sync copy errs :: master 0
Feb 29 2016 16:46:20 GMT: INFO (info): (thr_info.c::5009) trans_in_progress: wr 1 prox 0 wait 0 ::: q 0 ::: iq 0 ::: dq 0 : fds - proto (3640, 176311626, 176307986) : hb (38, 28035, 27997) : fab (282, 28128, 27846)
Feb 29 2016 16:46:20 GM

Keybase proof

I hereby claim:

  • I am tivvit on github.
  • I am tivvit (https://keybase.io/tivvit) on keybase.
  • I have a public key whose fingerprint is 2B24 11D3 1A0C E5BD C37C 7463 AF05 D14A 0DD0 A09F

To claim this, I am signing this object:

@tivvit
tivvit / Dockerfile
Last active June 26, 2018 16:35
python es incomplete read
FROM python:3.6
RUN pip3 install elasticsearch elasticsearch_dsl
@tivvit
tivvit / result.txt
Last active January 28, 2020 16:55
go type assertion speed
goos: darwin
goarch: amd64
pkg: go-speed
BenchmarkDirect-4 1000000000 0.286 ns/op
BenchmarkTypeAssert-4 666716210 1.78 ns/op
BenchmarkReflect-4 65340775 18.4 ns/op
PASS
ok go-speed 4.067s