Re: [Zinq-general] Patch to open data.cdb no more than once per second
Laurent Bercot <[email protected]>
| Newsgroups | gmane.network.djbdns |
|---|---|
| Message-ID | <[email protected]> |
> The idea is to minimize the per query overhead. I don't know that > trading a mmap/munmap per query for a stat per query would be that > great of a trade. Reopening data.cdb only upon receipt of, say, a > SIGHUP, would be even better, but that would *really* surprise people. By patching djbdns (no matter your choice of patches) you are already changing djbdns' behaviour. There's no harm in making changes to the interface as long as you properly document them. tinydns' current behaviour is to open data.cdb for every query. The advantage of this design is that the new data is served automatically as soon as data.cdb changes. The drawback is a performance impact. The "one-second" patch takes away the guarantee. The new guarantee it offers is "new data is served at most one second after data.cdb changes". The gain is better performance. Is the trade-off interesting? Notifying the server of a data change (for instance with a SIGHUP) gives you the best of both worlds: - best performance as long as data.cdb doesn't change - new data is published as soon as tinydns receives a SIGHUP, no timeout necessary. - the drawback is a change to the interface; again, I don't think it matters as long as you document the new behaviour. If you're going to patch tinydns anyway, go the whole way and give strong guarantees, even if it means changing the interface. I favour the SIGHUP patch over the one-second patch. -- Laurent