Hello, I'm loath to ask a question right off the blocks but I wasn't able to find too much in the archives about this... I'm using syslog-ng 1.5.14 and am trying to get the 'dns_cache(yes);' option to work for me. When compiled with -DNSCACHE_DEBUG I get this message to start with... initialising nscache: 1007 entries, 3600/60 expiration. ... but no messages to suggest nscache_lookup() or any of the other cache functions are ever being called. Is there more to this option than meets the eye? Other recent discussions have talked about using djb's dnscache or nscd to do this instead and questioned the wisdom of using caching internal to syslog-ng. Should I not be using this feature? Does it, in fact, work at all? M. -- WebCentral Pty Ltd Australia's #1 Internet Web Hosting Company Level 1, 96 Lytton Road. Network Operations - Systems Engineer PO Box 4169, East Brisbane. phone: +61 7 3249 2500 Queensland, Australia. pgp key id: 0x900E515F
On Tue, Mar 19, 2002 at 12:04:34PM +1000, Matthew Melvin wrote:
Hello,
I'm loath to ask a question right off the blocks but I wasn't able to find too much in the archives about this...
I'm using syslog-ng 1.5.14 and am trying to get the 'dns_cache(yes);' option to work for me. When compiled with -DNSCACHE_DEBUG I get this message to start with...
initialising nscache: 1007 entries, 3600/60 expiration.
... but no messages to suggest nscache_lookup() or any of the other cache functions are ever being called. Is there more to this option than meets the eye?
Other recent discussions have talked about using djb's dnscache or nscd to do this instead and questioned the wisdom of using caching internal to syslog-ng. Should I not be using this feature? Does it, in fact, work at all?
can you check this patch, whether it fixes your problem ? diff -u -r1.37 cfgfile.c --- cfgfile.c 2001/09/03 16:42:23 1.37 +++ cfgfile.c 2002/03/19 09:23:55 @@ -212,7 +212,14 @@ gc_idle_threshold = self->gc_idle_threshold; gc_busy_threshold = self->gc_busy_threshold; center = make_log_center(self->connections); - + + if (self->dns_cache) + self->cache = nscache_new(self->dns_cache_size, + self->dns_cache_expire, + self->dns_cache_expire_failed); + else + self->cache = NULL; + for (s = self->sources; s; s = s->next_source_group) { res = LOG_HANDLER_INIT(s, self, p); append_log_handler(s, center); @@ -244,13 +251,6 @@ RESOLVE_VAR(d, self->destinations, next_dest_group, i); } } - - if (self->dns_cache) - self->cache = nscache_new(self->dns_cache_size, - self->dns_cache_expire, - self->dns_cache_expire_failed); - else - self->cache = NULL; return 1; } -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
On Tue, 19 Mar 2002 at 10:24am (+0100), Balazs Scheidler wrote:
On Tue, Mar 19, 2002 at 12:04:34PM +1000, Matthew Melvin wrote:
Hello,
I'm loath to ask a question right off the blocks but I wasn't able to find too much in the archives about this...
I'm using syslog-ng 1.5.14 and am trying to get the 'dns_cache(yes);' option to work for me.
[...]
can you check this patch, whether it fixes your problem ?
diff -u -r1.37 cfgfile.c --- cfgfile.c 2001/09/03 16:42:23 1.37 +++ cfgfile.c 2002/03/19 09:23:55
[...] Thank you... it appears to be working as advertised now. When running with NSCACHE_DEBUG enabled we get lots of messages like... 202.139.234.86... found on 733: bne006m (1 iters, 1016578298/1016581888) 203.147.241.17... found on 760: bne010m (1 iters, 1016578298/1016581888) 202.139.235.196... found on 93: bne002m (1 iters, 1016578298/1016581888) 202.139.235.196... found on 93: bne002m (1 iters, 1016578298/1016581888) 202.139.234.87... found on 734: bne007m (1 iters, 1016578298/1016581888) 202.139.234.87... found on 734: bne007m (1 iters, 1016578298/1016581888) 202.139.234.86... found on 733: bne006m (1 iters, 1016578298/1016581888) 202.139.235.196... found on 93: bne002m (1 iters, 1016578298/1016581888) .... which looks good. CPU usage for the syslog process has dropped from ~80% to ~40% (hazzah!) and the named process that was doing local caching has dropped from ~10% to almost nill. M. -- WebCentral Pty Ltd Australia's #1 Internet Web Hosting Company Level 1, 96 Lytton Road. Network Operations - Systems Engineer PO Box 4169, East Brisbane. phone: +61 7 3249 2500 Queensland, Australia. pgp key id: 0x900E515F
participants (2)
-
Balazs Scheidler
-
Matthew Melvin