Heim  >  Fragen und Antworten  >  Hauptteil

Über time_local im Nginx-Protokoll

Wenn Sie eine bestimmte Schnittstelle wie Flash-Verkäufe basierend auf Nginx-Protokollen zählen möchten最大并发数 Das Nginx-Protokollformat ist wie folgt konfiguriert

log_format: $remote_addr [$time_local] "$request" $status $upstream_response_time $body_bytes_sent

Die offizielle Nginx-Dokumentation definiert es sotime_local

$time_local

Ortszeit im Common Log Format

Jetzt bin ich mir nicht sicher, ob dies der Zeitpunkt ist, zu dem die Anfrage eingeht, oder der Zeitpunkt, zu dem dieses Protokoll nach der Verarbeitung der Anfrage aufgezeichnet wird. Nur ersteres kann die maximale Anzahl von Parallelitäten basierend auf diesem Zeitpunkt zählen

高洛峰高洛峰2714 Tage vor873

Antworte allen(1)Ich werde antworten

  • 世界只因有你

    世界只因有你2017-05-16 17:14:27

    摘自:http://serverfault.com/questi...

    The $local_time variable contains the time when the log entry is written.

    when the HTTP request header is read, nginx does a lookup of the associated virtual server configuration. If the virtual server is found, the request goes through six phases:

    • server rewrite phase

    • location phase

    • location rewrite phase (which can bring the request back to the previous phase)

    • access control phase

    • try_files phase

    • log phase

    Since the log phase is the last one, $local_time variable is much more colse to the end of the request than it's start.

    Antwort
    0
  • StornierenAntwort