详解 golang 接口化编程
本文转自由Windfarer撰写的 Go工程化 - 依赖注入
之前在学习 Go 的接口化编程的时候,难以理解,有网友推荐了该文,我拜读之后,茅塞顿开。
本文转自由Windfarer撰写的 Go工程化 - 依赖注入
之前在学习 Go 的接口化编程的时候,难以理解,有网友推荐了该文,我拜读之后,茅塞顿开。
Author: Tiago Ilieve
Via: Here
Recently, I was talking to a long-time friend, previous university colleague and former boss, who mentioned the fact that Redis was failing to persist data to disk in low memory conditions. For that reason, he advised to never let a Redis in-memory dataset to be bigger than 50% of the system memory. Thinking about how wasteful that practice would be, it’s interesting to understand why this can happen and look for alternatives to assure that Redis will be able to use as much memory as there’s available to it, without sacrificing its durability.
最近研究如何实时的通过rsync传输日志文件,找到下面的文章,很详细。
在开始分析算法原理之前,简单说明下rsync的增量传输功能。
假设待传输文件为A,如果目标路径下没有文件A,则rsync会直接传输文件A,如果目标路径下已存在文件A,则发送端视情况决定是否要传输文件A。rsync默认使用"quick check"算法,它会比较源文件和目标文件(如果存在)的文件大小和修改时间mtime,如果两端文件的大小或mtime不同,则发送端会传输该文件,否则将忽略该文件。