Options: -c, --connections <N> Connections to keep open //连接数 -d, --duration <T> Duration of test //测试时间 -t, --threads <N> Number of threads to use //线程数
-s, --script <S> Load Lua script file //lua脚本 -H, --header <H> Add header to request //添加头信息 --latency Print latency statistics --timeout <T> Socket/request timeout -v, --version Print version details //版本信息 Numeric arguments may include a SI unit (1k, 1M, 1G) Time arguments may include a time unit (2s, 2m, 2h)
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag
where some-mysql is the name you want to assign to your container, my-secret-pw is the password to be set for the MySQL root user and tag is the tag specifying the MySQL version you want. See the list above for relevant tags.
1
docker run --name docker_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=your_password -d mysql
修改验证密码,修改后才能用root@密码登陆
1
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'your_password';
通过秘钥ssh到服务器,配置并连接过服务器,更换秘钥后无法连接,报错. 此时需要通过 ssh-keygen -R 服务器ip 删除记录,更换密钥后需要删除信息,不然无法使用新密钥登录 -R命令作用:Removes all keys belonging to hostname from a known_hosts file. This option is useful to delete hashed hosts (see the -H option above).
redis底层存储使用的不是简单的链表,使用了quicklist(快速链表:A doubly linked list of ziplists意思为一个由ziplist组成的双向链表)。 ziplist,压缩列表。它将所有的元素紧挨着一起存储,分配的是一块连续的内存。当数据量比较多的时候才会 改成 quicklist。因为普通的链表需要的附加指针空间太大,会比较浪费空间,而且会加重内存的碎片化。
set
Usage
api
redis support sadd,members…
1 2 3 4 5 6 7 8 9 10 11 12 13
// using go-zero gofunc() { for { s := time.Now().Second() redis.Sadd("order_id"+strconv.Itoa(s), strconv.Itoa(s)) } }() tt := time.NewTicker(time.Second) for now := range tt.C { vs, _ := rr.Smembers("order_id" + strconv.Itoa(now.Second() )) fmt.Println(now.Second(), vs) redis.Del("order_id" + strconv.Itoa(now.Second())) }