Uk0's space

逐渐呆

Category

  • 硬件
  • 软件
  • 随记

Tags

  • linux
  • tdengine
  • PanoLogicG1
  • mount
  • lvm
  • Kubernetes
  • nginx
  • spark
  • kafka
  • trojan-go
  • Jenkins
  • attack
  • kargo
  • disk
  • gitolite
  • lsp
  • hacker
  • 斐讯k2p
  • go
  • MacM1 ARMV8
  • macos
  • rocketmq
  • for me
  • docker
  • ngrok
  • git
  • middleware
  • telegram
  • rust
  • ceph
  • 互信
  • kcp

Recent replies

  • uk0 发表于「About」
  • firshme 发表于「About」
  • 盐果 发表于「About」
  • 盐果 发表于「About」
  • 陈冠希 发表于「mongodb 被攻击,数据目前在恢复。」

My

RSS (中文优先)
RSS (English preferred)

坑 / Projects
关于我 / About
GitHub

Links

zephray(wenting)
cnVintage古董电子论坛
cnCalc计算器论坛

Keshuai Xu
Bleem
>Lithia's Core
ntzyz's space
丘丘塔台
tonoko.moe
kasora's blog
447f.Misaka
paizhang.info
spinmry实验室
电子考古学
Hikari Calyx Tech.
春上冰月的博客
业余无线电台 BD4SUR
FindHao
Test2g
Shell Bin
LEAFER x LAB

其他

买服务器
续费服务器

在线用户

标签:go

Golang Log 输出过于频繁导致磁盘IO刷盘变慢。

2021 年 9 月 23 日分类:随记#go

项目中有一些使用Golang进行开发的中间件,以及小工具,现在检查服务器IO发现Golang的日志输出导致磁盘IO紧张,现在采取 RingBuffer + Driect IO进行处理

package logger

import (
	"errors"
)

var (

	ErrClosed = errors.New("logger is closed")
)

// Logger 基本方法
type Logger interface {
	Write(b []byte) (n int, err error)
	flush()
	worker()
	GetWriter()(interface{})
}
MORE
  • «
  • 1
  • »
Copyright © 2016-2021 firshme. All rights reserved.
Except where otherwise noted, content on this blog is licensed under CC-BY 2.0.