2015-06-10 10 views
5

Jak często nginx domyślnie opróżnia swój bufor domyślnie do access_log?Nginx access_log domyślny czas spłukiwania

W instrukcji nie ma informacji, składnia konfiguracji tylko:

access_log path [format [buffer=size [flush=time]] [if=condition]]; 
+3

domyślnie nginx nie wykorzystuje bufor. –

Odpowiedz

1

Czy trochę badań na ten sam i tak daleko, jak można stwierdzić nginx nie przemywać bufory w ogóle, jeśli nie podać parametr płukania. (Lub jeśli tak, to jest więcej niż 20 minut.)

Jedynym wyjątkiem jest ponowne uruchomienie serwera, logi są opróżniane przed ponownym uruchomieniem.

Jeśli więc podasz bufor, upewnij się, że podałeś również czas płukania.

0

Z dokumentacji nginx [1]:

When buffering is enabled, the data will be written to the file: 

- if the next log line does not fit into the buffer; 
- if the buffered data is older than specified by the flush parameter (1.3.10, 1.2.7); 
- when a worker process is re-opening log files or is shutting down. 

Oczywiście, jeśli nie określono parametru flush drugi warunek nie może stać się prawdą.

[1] http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log