[PR #72] [CLOSED] Add closest flag and automatic geographic load balancing #116

Closed
opened 2026-02-28 14:16:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/abh/geodns/pull/72
Author: @abligh
Created: 8/15/2015
Status: Closed

Base: masterHead: add-closest-flag


📝 Commits (3)

📊 Changes

8 files changed (+166 additions, -27 deletions)

View changed files

📝 geoip.go (+26 -1)
📝 picker.go (+55 -2)
📝 serve.go (+12 -3)
📝 serve_test.go (+4 -0)
📝 targeting.go (+5 -6)
📝 targeting_test.go (+5 -5)
📝 zone.go (+30 -2)
📝 zones.go (+29 -8)

📄 Description

This is an experimental feature to provide automatic geographic loadbalancing by choosing the group of servers with the lowest geographic distance to the query originator.

This is lightly tested. However, it should not affect normal operation unless you turn it on.

Information from the commit:

Add 'closest' flag

This changeset adds a new boolean option 'closest' to the zone options
and to the label options. The label option defaults to the zone option
for 'closest'.

When closest is set on a label within a zone, each A record has its
location determined and stored in memory. When a query is received,
after the targeting process is performed, the geographically closest
group of A records are selected prior to the weight algorithm being
applied.

In practice this means you can use a simple technique (set 'closest'
to be "true") to choose the geographically closest servers. Note
that geographic proximity may not correlate perfectly to topological
proximity.

Note that when 'closest' is selected on any label within the zone,
the GEOIP_CITY_EDITION_REV1 geoip data is required, as that is what
contains latitude and longitude data.

No provision is currently made for servers that change longitude
and latitude (most likely due to a geoip data change) during the
runtime life of the server.

Signed-off-by: Alex Bligh <alex@alex.org.uk>

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/abh/geodns/pull/72 **Author:** [@abligh](https://github.com/abligh) **Created:** 8/15/2015 **Status:** ❌ Closed **Base:** `master` ← **Head:** `add-closest-flag` --- ### 📝 Commits (3) - [`cc09d9d`](https://github.com/abh/geodns/commit/cc09d9d9917f030ed6f58df602fb03667e5e73b1) Add delay to test start. - [`d763f74`](https://github.com/abh/geodns/commit/d763f7429ec8abcf527cbb1a461624d9b5aa74b8) Remove minimum TTL for NS records - [`901652a`](https://github.com/abh/geodns/commit/901652ab76d5e03c69dc5756561913e8528ec1b3) Add 'closest' flag ### 📊 Changes **8 files changed** (+166 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `geoip.go` (+26 -1) 📝 `picker.go` (+55 -2) 📝 `serve.go` (+12 -3) 📝 `serve_test.go` (+4 -0) 📝 `targeting.go` (+5 -6) 📝 `targeting_test.go` (+5 -5) 📝 `zone.go` (+30 -2) 📝 `zones.go` (+29 -8) </details> ### 📄 Description This is an experimental feature to provide automatic geographic loadbalancing by choosing the group of servers with the lowest geographic distance to the query originator. This is lightly tested. However, it should not affect normal operation unless you turn it on. Information from the commit: ``` Add 'closest' flag This changeset adds a new boolean option 'closest' to the zone options and to the label options. The label option defaults to the zone option for 'closest'. When closest is set on a label within a zone, each A record has its location determined and stored in memory. When a query is received, after the targeting process is performed, the geographically closest group of A records are selected prior to the weight algorithm being applied. In practice this means you can use a simple technique (set 'closest' to be "true") to choose the geographically closest servers. Note that geographic proximity may not correlate perfectly to topological proximity. Note that when 'closest' is selected on any label within the zone, the GEOIP_CITY_EDITION_REV1 geoip data is required, as that is what contains latitude and longitude data. No provision is currently made for servers that change longitude and latitude (most likely due to a geoip data change) during the runtime life of the server. Signed-off-by: Alex Bligh <alex@alex.org.uk> ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 14:16:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/geodns#116
No description provided.