Skip maintaining filter wx and entrycall tables if no filtered listeners enabled
This commit is contained in:
parent
c7acfe75f4
commit
f8eaf0fdbd
|
|
@ -1475,8 +1475,8 @@ void accept_thread(void *asdf)
|
|||
n++;
|
||||
}
|
||||
hlog(LOG_INFO, "Accept thread ready.");
|
||||
historydb_enabled = has_filtered_listeners_now;
|
||||
if (!historydb_enabled)
|
||||
have_filtered_listeners = has_filtered_listeners_now;
|
||||
if (!have_filtered_listeners)
|
||||
hlog(LOG_INFO, "Disabled historydb, listeners do not have filtering enabled.");
|
||||
|
||||
/* stop the dupechecking and uplink threads while adjusting
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ int dupecheck_running;
|
|||
pthread_t dupecheck_th;
|
||||
long dupecheck_cellgauge;
|
||||
|
||||
int historydb_enabled; /* historydb inserts enabled only if filtering available */
|
||||
|
||||
int pbuf_global_count;
|
||||
int pbuf_global_dupe_count;
|
||||
|
||||
|
|
@ -656,7 +654,7 @@ static int dupecheck_drain_worker(struct worker_t *w,
|
|||
* is enabled (disabled if no filtered listeners
|
||||
* configured, for memory savings)
|
||||
*/
|
||||
if (historydb_enabled) {
|
||||
if (have_filtered_listeners) {
|
||||
historydb_insert(pb);
|
||||
filter_postprocess_dupefilter(pb);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ extern long long dupecheck_dupecount; /* statistics counter */
|
|||
extern long long dupecheck_dupetypes[DTYPE_MAX+1];
|
||||
extern long dupecheck_cellgauge; /* statistics gauge */
|
||||
|
||||
extern int historydb_enabled;
|
||||
extern int dupecheck_eventfd;
|
||||
|
||||
extern int outgoing_lag_report(struct worker_t *self, int*lag, int*dupelag);
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ cellarena_t *filter_entrycall_cells;
|
|||
cellarena_t *filter_wx_cells;
|
||||
#endif
|
||||
|
||||
int have_filtered_listeners; /* do we have any filtered listeners, do we need to support them */
|
||||
|
||||
#define HIST_LOOKUP_INTERVAL 10 /* Cache historydb position lookups this much seconds on
|
||||
each filter entry referring to some
|
||||
|
|
@ -801,9 +802,12 @@ static void filter_keyhashes(struct pbuf_t *pb)
|
|||
|
||||
void filter_preprocess_dupefilter(struct pbuf_t *pbuf)
|
||||
{
|
||||
// TODO: could probably skip filter_check_tcpip, and possibly filter_keyhashes too if no filtered listeners
|
||||
filter_check_tcpip(pbuf);
|
||||
filter_entrycall_insert(pbuf);
|
||||
filter_wx_insert(pbuf);
|
||||
if (have_filtered_listeners) {
|
||||
filter_entrycall_insert(pbuf);
|
||||
filter_wx_insert(pbuf);
|
||||
}
|
||||
filter_keyhashes(pbuf);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ extern void filter_wx_dump(FILE *fp);
|
|||
|
||||
extern int filter_cellgauge;
|
||||
|
||||
extern int have_filtered_listeners;
|
||||
|
||||
extern float filter_lat2rad(float lat);
|
||||
extern float filter_lon2rad(float lon);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue