Commit 4b54b03e authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: added stats len_overflow and data_overflow to monitoring

           main thread uses signal (not broadcast) to wake up a thread
           waiting for data
vcl:       unsetting cookie in 204 response (needs to be anonymized)
parent 01871d35
...@@ -144,8 +144,8 @@ DATA_Init(void) ...@@ -144,8 +144,8 @@ DATA_Init(void)
datatable init_tbl = datatable init_tbl =
{ .magic = DATATABLE_MAGIC, .len = entries, .collisions = 0, { .magic = DATATABLE_MAGIC, .len = entries, .collisions = 0,
.insert_probes = 0, .find_probes = 0, .seen = 0, .open = 0, .done = 0, .insert_probes = 0, .find_probes = 0, .seen = 0, .open = 0, .done = 0,
.submitted = 0, .occ_hi = 0, .data_hi = 0, .entry = entryptr, .len_overflows = 0, .data_overflows = 0, .submitted = 0, .occ_hi = 0,
.buf = bufptr }; .data_hi = 0, .entry = entryptr, .buf = bufptr };
memcpy(&tbl, &init_tbl, sizeof(datatable)); memcpy(&tbl, &init_tbl, sizeof(datatable));
for (int i = 0; i < entries; i++) { for (int i = 0; i < entries; i++) {
...@@ -171,8 +171,10 @@ dataentry ...@@ -171,8 +171,10 @@ dataentry
while (++probes <= tbl.len && tbl.entry[INDEX(h)].state != DATA_EMPTY) while (++probes <= tbl.len && tbl.entry[INDEX(h)].state != DATA_EMPTY)
h++; h++;
tbl.insert_probes += probes; tbl.insert_probes += probes;
if (probes > tbl.len) if (probes > tbl.len) {
tbl.len_overflows++;
return(NULL); return(NULL);
}
return(&tbl.entry[INDEX(h)]); return(&tbl.entry[INDEX(h)]);
} }
......
...@@ -70,12 +70,13 @@ void ...@@ -70,12 +70,13 @@ void
} }
LOG_Log(LOG_INFO, LOG_Log(LOG_INFO,
"Data table: len=%d collisions=%d insert_probes=%d find_probes=%d " "Data table: len=%d collisions=%d insert_probes=%d find_probes=%d "
"open=%d done=%d load=%.2f occ_hi=%d seen=%d submitted=%d " "open=%d done=%d load=%.2f len_overflows=%d data_overflows=%d "
"sent=%d failed=%d wait_qfull=%d data_hi=%d", "occ_hi=%d seen=%d submitted=%d sent=%d failed=%d wait_qfull=%d "
"data_hi=%d",
tbl.len, tbl.collisions, tbl.insert_probes, tbl.find_probes, tbl.len, tbl.collisions, tbl.insert_probes, tbl.find_probes,
tbl.open, tbl.done, 100.0 * ((float) tbl.open + tbl.done) / tbl.len, tbl.open, tbl.done, 100.0 * ((float) tbl.open + tbl.done) / tbl.len,
tbl.occ_hi, tbl.seen, tbl.submitted, tbl.sent, tbl.failed, tbl.len_overflows, tbl.data_overflows, tbl.occ_hi, tbl.seen,
tbl.wait_qfull, tbl.data_hi); tbl.submitted, tbl.sent, tbl.failed, tbl.wait_qfull, tbl.data_hi);
WRK_Stats(); WRK_Stats();
} }
......
...@@ -114,7 +114,7 @@ submit(unsigned xid) ...@@ -114,7 +114,7 @@ submit(unsigned xid)
AZ(pthread_mutex_lock(&spmcq_nonfull_lock)); AZ(pthread_mutex_lock(&spmcq_nonfull_lock));
AZ(pthread_cond_wait(&spmcq_nonfull_cond, &spmcq_nonempty_lock)); AZ(pthread_cond_wait(&spmcq_nonfull_cond, &spmcq_nonempty_lock));
} }
AZ(pthread_cond_broadcast(&spmcq_nonempty_cond)); AZ(pthread_cond_signal(&spmcq_nonempty_cond));
tbl.submitted++; tbl.submitted++;
} }
...@@ -223,6 +223,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len, ...@@ -223,6 +223,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
"%s: Data too long, XID=%d, current length=%d, " "%s: Data too long, XID=%d, current length=%d, "
"DISCARDING data=[%.*s]", VSL_tags[tag], xid, entry->end, "DISCARDING data=[%.*s]", VSL_tags[tag], xid, entry->end,
datalen, data); datalen, data);
tbl.data_overflows++;
break; break;
} }
...@@ -491,9 +492,13 @@ child_main(struct VSM_data *vd, int endless) ...@@ -491,9 +492,13 @@ child_main(struct VSM_data *vd, int endless)
term = 0; term = 0;
/* XXX: Varnish restart? */ /* XXX: Varnish restart? */
/* XXX: TERM not noticed until request received */ /* XXX: TERM not noticed until request received */
while (VSL_Dispatch(vd, OSL_Track, NULL)) while (VSL_Dispatch(vd, OSL_Track, NULL) > 0)
if (term || !endless) if (term || !endless)
break; break;
else {
LOG_Log0(LOG_WARNING, "Log read interrupted, continuing");
continue;
}
WRK_Halt(); WRK_Halt();
WRK_Shutdown(); WRK_Shutdown();
......
...@@ -113,6 +113,8 @@ typedef struct { ...@@ -113,6 +113,8 @@ typedef struct {
unsigned seen; /* Records (ReqStarts) seen */ unsigned seen; /* Records (ReqStarts) seen */
unsigned open; unsigned open;
unsigned done; unsigned done;
unsigned len_overflows;
unsigned data_overflows;
unsigned submitted; /* Records submitted */ unsigned submitted; /* Records submitted */
unsigned sent; /* Records sent to MQ */ unsigned sent; /* Records sent to MQ */
unsigned failed; /* MQ send fails */ unsigned failed; /* MQ send fails */
......
...@@ -48,6 +48,7 @@ sub vcl_recv_track { ...@@ -48,6 +48,7 @@ sub vcl_recv_track {
regsub(req.url, "^.+\?(.+)$", "\1")); regsub(req.url, "^.+\?(.+)$", "\1"));
} }
set req.url = "/ts-processor/204"; set req.url = "/ts-processor/204";
unset req.http.Cookie;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment