Skip to content

Instantly share code, notes, and snippets.

View c4pt0r's full-sized avatar

dongxu c4pt0r

View GitHub Profile
@c4pt0r
c4pt0r / tpcc.conf
Created May 26, 2019 21:46
tpcc configuration for TiDB
db=mysql
driver=com.mysql.jdbc.Driver
conn=jdbc:mysql://0.0.0.0:6000/tpcc?useSSL=false&useServerPrepStmts=true&useConfigs=maxPerformance&rewriteBatchedStatements=false&callableStmtCacheSize=1000&prepStmtCacheSize=1000&sessionVariables=tidb_batch_commit=1
user=root
password=
warehouses=1000
loadWorkers=32
terminals=500
@c4pt0r
c4pt0r / tikv.toml.patch
Created May 26, 2019 17:06
tikv config for sysbench
diff --git a/conf/tidb.yml b/conf/tidb.yml
index d7e1d23..6e15aab 100644
--- a/conf/tidb.yml
+++ b/conf/tidb.yml
@@ -42,7 +42,7 @@ global:
log:
# Log level: debug, info, warn, error, fatal.
- # level: "info"
+ level: "error"
@c4pt0r
c4pt0r / task-aurora.yaml
Created May 16, 2019 03:51
task-aurora.yaml
name: test
task-mode: all
is-sharding: false
meta-schema: "dm_meta"
remove-meta: false
enable-heartbeat: false
ignore-checking-items: ["dump_privilege", "replication_privilege"]
target-database:
host: ""
{
"comment": "",
"ignore": "test",
"package": [
{
"checksumSHA1": "2sLgks1Fi3Dek1svURoHiI95gAw=",
"origin": "github.com/pingcap/tidb/vendor/github.com/BurntSushi/toml",
"path": "github.com/BurntSushi/toml",
"revision": "418cdf2308c8ebedadbf356142f9afbab9aea111",
"revisionTime": "2018-09-03T23:56:42Z"
@c4pt0r
c4pt0r / benchseek.go
Last active January 10, 2018 07:21
A simple demo of TiKV's prefix seek API
// A simple demo of TiKV's prefix seek API
/*
$./benchseek
INFO[0000] [pd] create pd client with endpoints [localhost:2379]
INFO[0000] [pd] leader switches to: http://127.0.0.1:2379, previous:
INFO[0000] [pd] init cluster id 6508961674812833664
hello_1
hello_2
hello_3
@c4pt0r
c4pt0r / dlock.go
Created March 19, 2017 11:26
simple distributed lock using TiKV
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"math/rand"
"time"
2016 数据库圈盘点
我简单说一下今年我觉得印象比较深刻的几个事情:
1. Facebook 和 Percona 合作 MyRocks 正式进入市场
2. MySQL Group Replication 发布, 基于选举的 Replication 方案正式进场
3. Hive 2.0 的发布,新的 feature 和性能提升让我蛮惊艳的
4. RethinkDB 的落幕
5. CockacheDB 、 TiDB 这类的 NewSQL 在社区展露头角
6. SycallaDB 的发布,让我看到了性能提升上的一些新的思路
@c4pt0r
c4pt0r / compression.h
Created December 8, 2016 10:24
compression.h
inline bool Zlib_Compress(const CompressionOptions& opts,
uint32_t compress_format_version, const char* input,
size_t length, ::std::string* output,
const Slice& compression_dict = Slice()) {
#ifdef ZLIB
if (length > std::numeric_limits<uint32_t>::max()) {
// Can't compress more than 4GB
return false;
}
@c4pt0r
c4pt0r / coisf.md
Last active November 20, 2016 12:36
coisf - 中国开源基础软件基金会

##章程


使命 (Mission)

China Open Infrastructure Software Foundation,以下简称 COISF 或 COI,致力于促进和发展中国的新一代开源基础软件, COISF 的使命是:促进中国下一代开源互联网基础软件生态系统的发展。

新一代的开源基础设施需要具备以下的条件:

  1. Scale:面向云和更大规模的分布式系统设计,系统高度自治和自动化。
#!/usr/bin/env python
import os
import math
pts = [(1,1), (0,0), (0.5, 0)]
def distance(p, p2):
return math.sqrt((p[0]-p2[0])*(p[0]-p2[0]) + (p[1]-p2[1])*(p[1]-p2[1]))
def nearest(s, e):