From 8155b0821e35a7cb26c707aa258c996fa43b8b86 Mon Sep 17 00:00:00 2001 From: Brian Cunnie Date: Wed, 19 Jan 2022 07:15:15 -0800 Subject: [PATCH] =?UTF-8?q?Drop=20TTL=20300=20=E2=86=92=20180=20seconds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I want the key-value changes to propagate faster, so I dropped the TTL. Now, on average, it'll take on average 90 seconds for a stale value to clear out, 3 minutes max. I don't think this will affect traffic much; I suspect that there's not much negative-caching going on (based on the queries I see), and the lion's share of queries (I believe over 3/4 of my traffic are things I don't have a record for). And I average ~5 queries-with-a-record-returned per second on ns-aws, which means that'll bump to a little more than 8 queries a second. --- .../sslip.io-dns-server/integration_test.go | 22 +++++++++---------- .../src/sslip.io-dns-server/xip/xip.go | 8 ++++--- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/bosh-release/src/sslip.io-dns-server/integration_test.go b/bosh-release/src/sslip.io-dns-server/integration_test.go index ac6bff8..7fd1aac 100644 --- a/bosh-release/src/sslip.io-dns-server/integration_test.go +++ b/bosh-release/src/sslip.io-dns-server/integration_test.go @@ -59,7 +59,7 @@ var _ = Describe("sslip.io-dns-server", func() { Entry("A (or lack thereof) for example.com", "@localhost example.com +short", `\A\z`, - `TypeA example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `TypeA example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry("A for www-127-0-0-1.sslip.io", "@localhost www-127-0-0-1.sslip.io +short", `\A127.0.0.1\n\z`, @@ -75,7 +75,7 @@ var _ = Describe("sslip.io-dns-server", func() { Entry("AAAA not found for example.com", "@localhost example.com aaaa +short", `\A\z`, - `TypeAAAA example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `TypeAAAA example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry("AAAA for www-2601-646-100-69f0-1c09-bae7-aa42-146c.sslip.io", "@localhost www-2601-646-100-69f0-1c09-bae7-aa42-146c.sslip.io aaaa +short", `\A2601:646:100:69f0:1c09:bae7:aa42:146c\n\z`, @@ -92,23 +92,23 @@ var _ = Describe("sslip.io-dns-server", func() { Entry("CNAME not found for example.com", "@localhost example.com cname +short", `\A\z`, - `TypeCNAME example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `TypeCNAME example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry("MX for example.com", "@localhost example.com mx +short", `\A0 example.com.\n\z`, `TypeMX example.com. \? 0 example.com.\n$`), Entry("SOA for sslip.io", "@localhost sslip.io soa +short", - `\Asslip.io. briancunnie.gmail.com. 2021123100 900 900 1800 300\n\z`, - `TypeSOA sslip.io. \? sslip.io. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `\Asslip.io. briancunnie.gmail.com. 2022011900 900 900 1800 180\n\z`, + `TypeSOA sslip.io. \? sslip.io. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry("SOA for example.com", "@localhost example.com soa +short", - `\Aexample.com. briancunnie.gmail.com. 2021123100 900 900 1800 300\n\z`, - `TypeSOA example.com. \? example.com. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `\Aexample.com. briancunnie.gmail.com. 2022011900 900 900 1800 180\n\z`, + `TypeSOA example.com. \? example.com. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry("SRV (or other record that we don't implement) for example.com", "@localhost example.com srv +short", `\A\z`, - `TypeSRV example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `TypeSRV example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry(`TXT for version.status.sslip.io is the version number of the xip software (which gets overwritten during linking)`, "@127.0.0.1 version.status.sslip.io txt +short", `\A"dev"\n"today"\n"xxx"\n\z`, @@ -120,11 +120,11 @@ var _ = Describe("sslip.io-dns-server", func() { Entry(`TXT is the querier's IPv4 address and the domain is NOT "ip.sslip.io"`, "@127.0.0.1 example.com txt +short", `\A\z`, - `TypeTXT example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `TypeTXT example.com. \? nil, SOA example.com. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry(`getting a non-existent value: TXT for my-key.k-v.io"`, "@127.0.0.1 my-key.k-v.io txt +short", `\A\z`, - `TypeTXT my-key.k-v.io. \? nil, SOA my-key.k-v.io. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `TypeTXT my-key.k-v.io. \? nil, SOA my-key.k-v.io. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), Entry(`putting a value: TXT for put.MyValue.MY-KEY.k-v.io"`, "@127.0.0.1 put.MyValue.MY-KEY.k-v.io txt +short", `"MyValue"`, @@ -140,7 +140,7 @@ var _ = Describe("sslip.io-dns-server", func() { Entry(`getting a non-existent value: TXT for my-key.k-v.io"`, "@127.0.0.1 my-key.k-v.io txt +short", `\A\z`, - `TypeTXT my-key.k-v.io. \? nil, SOA my-key.k-v.io. briancunnie.gmail.com. 2021123100 900 900 1800 300\n$`), + `TypeTXT my-key.k-v.io. \? nil, SOA my-key.k-v.io. briancunnie.gmail.com. 2022011900 900 900 1800 180\n$`), ) }) Describe("for more complex assertions", func() { diff --git a/bosh-release/src/sslip.io-dns-server/xip/xip.go b/bosh-release/src/sslip.io-dns-server/xip/xip.go index f0398b5..51d70da 100644 --- a/bosh-release/src/sslip.io-dns-server/xip/xip.go +++ b/bosh-release/src/sslip.io-dns-server/xip/xip.go @@ -755,12 +755,14 @@ func SOAResource(name dnsmessage.Name) dnsmessage.SOAResource { return dnsmessage.SOAResource{ NS: name, MBox: mbox, - Serial: 2021123100, - // cribbed the Refresh/Retry/Expire from google.com + Serial: 2022011900, + // cribbed the Refresh/Retry/Expire from google.com. + // MinTTL was 300, but I dropped to 180 for faster + // key-value propagation Refresh: 900, Retry: 900, Expire: 1800, - MinTTL: 300, + MinTTL: 180, } }