1 Star 0 Fork 0

infra-io / kafo-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

☕ kafo-client License

Kafo-client 是 kafo 缓存服务的客户端,而 kafo 是一个高性能的轻量级分布式缓存中间件,支持 tcp/http 调用。

🖊 使用指南

  • 下载依赖:
go get github.com/avino-plan/kafo-client
  • 开始编码:
package main

import (
	"github.com/avino-plan/kafo-client"
)

func main() {

	config := kafo.DefaultConfig()
	client, err := kafo.NewTCPClient([]string{"127.0.0.1:5837"}, config)
	if err != nil {
		panic(err)
	}
	defer client.Close()

	// ...
}

⚛ 性能测试

R7-4700U,16GB RAM,1000 并发,每个并发 10 个 key,节点数是指 kafo 的进程数

操作 单节点 双节点 三节点 四节点 五节点
写入 478ms 263ms 236ms 231ms 230ms
读取 475ms 262ms 233ms 226ms 219ms
rps 21053 38168 42918 44248 45662

可以看到,随着节点数的提升,性能也在提升,尤其是从单节点变成双节点的时候,性能提升达到了 81%!这是在意料之中的,因为多节点会使用多个 TCP 连接。

但我们也可以看到随着节点数的提升,性能提升的幅度逐渐变小,主要是因为在我的笔记本上测试没办法在网络上达到完全的并行,如果是独立的物理机,相信提升幅度还会更大!

🔬 kafo-client 使用的技术

项目 作者 描述 链接
vex FishGoddess 一个高性能、且极易上手的网络通信框架 GitHub / 码云
The MIT License (MIT) Copyright (c) 2020 Ye Zi Jie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Kafo 缓存服务的客户端 - A client for kafo cache service 展开 收起
Go
MIT
取消

发行版 (2)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/infra-io/kafo-client.git
git@gitee.com:infra-io/kafo-client.git
infra-io
kafo-client
kafo-client
main

搜索帮助