Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qiuzhanghua/qraft_go
https://github.com/qiuzhanghua/qraft_go
Last synced: about 18 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/qiuzhanghua/qraft_go
- Owner: qiuzhanghua
- Created: 2022-08-30T03:03:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-02T03:01:46.000Z (about 2 years ago)
- Last Synced: 2024-06-20T21:07:44.501Z (5 months ago)
- Language: Go
- Size: 71.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Prerequisite
```bash
go install github.com/qiuzhanghua/autotag@latest
```# Build and Run
```bash
make && BUNDEBUG=error ./qraft
```# Redis
on my m1x, redis cluster nodes=6
```bash
wrk -t12 -c200 -d30s http://localhost:9999/rdb
```
1. 不设置PoolSize,33k qps
2. PoolSize = 1, 38k qps
3. PoolSize = 2, 63k qps
4. PoolSize = 3, 72k qps, with few socket errors
5. PoolSize = 4, 76k qps, with few socket errors所以PoolSize建议设置3或者2(生产环境中也需要验证测试一下).
# MySQL
on my m1x, 8.0.30
```bash
wrk -t12 -c200 -d30s http://localhost:9999/db
``````go
maxOpenConns := 4 * runtime.GOMAXPROCS(0)
sql.SetMaxOpenConns(maxOpenConns)
sql.SetMaxIdleConns(maxOpenConns)
sql.SetConnMaxIdleTime(2 * time.Second)
sql.SetConnMaxLifetime(30 * time.Second)...
var ver string
err = db.NewRaw("SELECT version() as v").Scan(ctx, &ver)```
约为32k qps.# Create MSSQL user
login as sa, and
```sql
create login app with password='App@123456';
use app;
CREATE USER app FROM LOGIN app;
GRANT CONTROL ON DATABASE::app TO app;
```