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-
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%
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 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