摘要:
1. 现象服务的cpu跑满(golang实现), 并大量报too many open files错误.服务使用systemd来运行,部署在阿里ecs上. 2.分析从日志来看,cpu的上升主要为到达文件数限制引起的,但之前已经更改过系统的文件数及所有用户的文件数,按道理是不应该出现这个问题的,后来查阅资料发现,文件数可以从三个维度限制分别为操作系统限制,用户态限制,以及进程限制,对于这三个维度选取最... 阅读全文
摘要:
package mirrorimport ( "github.com/coreos/etcd/clientv3" "golang.org/x/net/context")const ( batchLimit = 1000)// Syncer syncs with the key-value state of an etcd cluster.type Syncer interface... 阅读全文
摘要:
package concurrencyimport ( v3 "github.com/coreos/etcd/clientv3" "golang.org/x/net/context")// STM is an interface for software transactional memory.type STM interface { // Get returns the va... 阅读全文
摘要:
package concurrencyimport ( "time" v3 "github.com/coreos/etcd/clientv3" "golang.org/x/net/context")const defaultSessionTTL = 60// Session represents a lease kept alive for the lifetime of a c... 阅读全文