Skip to content

Instantly share code, notes, and snippets.

Gledis-server -config=rocksdb.conf
2014/08/29 17:58:20
%CPU %MEM
163.5 2.9
2014/08/29 17:58:30
%CPU %MEM
231.4 3.7
@holys
holys / wait.go
Last active August 29, 2015 14:05
package main
import "fmt"
import "sync"
var wg sync.WaitGroup
// from: http://se77en.cc/2014/06/30/array-slice-map-and-set-in-golang/
package main
import(
"fmt"
"sync"
)
type Set struct {
rm -rf 1
start=$(date +%s)
for i in {1..10}
do
for j in {1..10}
do
for k in {1..10}
do
for l in {1..10}
package main
import (
"encoding/json"
"fmt"
)
type Vip struct {
ExpireTime int `json:"expire_time"`
MemberId int `json:"memberid"`
@holys
holys / a.go
Last active August 29, 2015 14:06
//refer: http://localhost:6060/blog/defer-panic-and-recover
package main
import (
"fmt"
)
//1. A deferred function's arguments are evaluated when the defer statement is evaluated.
func a() {
i := 0
@holys
holys / b.go
Last active August 29, 2015 14:07
xiaomi oauth signature
package main
import (
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"fmt"
"io"
"net/url"
)
@holys
holys / c.go
Last active August 29, 2015 14:07
package main
import (
"crypto/rand"
"fmt"
)
type UUID [16]byte
func NewUUID() *UUID {
@holys
holys / rp.go
Created October 27, 2014 11:24
package main
import (
"fmt"
)
func a(i int) int {
i = i + 1
if i <= 0 {
return a(i)
@holys
holys / redis-benchmark.txt
Last active August 29, 2015 14:08
-P 区别真不是一般的大。 bulk rocks
% redis-benchmark -n 100000 -q -h 10.20.151.151 -P 128 holys@macmini
PING_INLINE: 1219512.12 requests per second
PING_BULK: 1204819.38 requests per second
SET: 507614.22 requests per second
GET: 892857.12 requests per second
INCR: 546448.06 requests per second
LPUSH: 581395.31 requests per second
LPOP: 606060.56 requests per second
SADD: 714285.69 requests per second
SPOP: 1086956.50 requests per second