[go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread Tamás Gulácsi
Don't Stat on every log line, but use some other mechanism (mutex, channel) to rotate the logs every day. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-

Re: [go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread Konstantin Khomoutov
On Mon, 27 Jun 2016 00:21:01 -0700 (PDT) feng19910...@gmail.com wrote: [...] > After running several times the system file cache becomes very large > > CONTAINERCPU % MEM USAGE / LIMIT MEM % NET > I/O BLOCK I/O zyapi_801138.47%6.442 GB / 6.442 GB > 100.00%

Re: [go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread Jan Mercl
On Mon, Jun 27, 2016 at 4:16 PM wrote: > After running several times the system file cache becomes very large File caches usually try to use any unused RAM the system has. If you write xGB of data to some file(s) and there is at least xGB of idle RAM in the system, I'd expect the system to cache

[go-nuts] File method WriteString frequent calls led to a large system cache

2016-06-27 Thread feng19910104
*go code* package main import ( "fmt" "net/http" "os" "time" ) var logCtxCh chan *http.Request var accessLogFile *os.File type HandlerHttp struct{} func (this *HandlerHttp) ServeHTTP(w http.ResponseWriter, req *http.Request) { sendAccessLog(req) w.Write([]byte("Hello W