{"id":22911857,"url":"https://github.com/valtri/packaging-lbnamed","last_synced_at":"2025-04-01T10:47:33.329Z","repository":{"id":69640488,"uuid":"59956167","full_name":"valtri/packaging-lbnamed","owner":"valtri","description":"Packaging of load-balancing DNS server","archived":false,"fork":false,"pushed_at":"2016-05-29T17:45:57.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T06:14:55.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valtri.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-29T17:44:13.000Z","updated_at":"2022-10-01T19:59:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"90573509-dd5d-4323-abc5-37f638c4cac8","html_url":"https://github.com/valtri/packaging-lbnamed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtri%2Fpackaging-lbnamed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtri%2Fpackaging-lbnamed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtri%2Fpackaging-lbnamed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtri%2Fpackaging-lbnamed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valtri","download_url":"https://codeload.github.com/valtri/packaging-lbnamed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246628418,"owners_count":20808106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T04:18:41.407Z","updated_at":"2025-04-01T10:47:33.290Z","avatar_url":"https://github.com/valtri.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n  Contents\n  ========\n\n  Introduction\n  Collecting and Summarizing Host Metrics\n  Answering DNS Queries\n  TTLs and MXes\n  Configuring lbnamed\n  The Load-Balanced Client Daemon\n  Duh\n  Conclusion\n\n\n  Introduction\n  ============\n\n  lbnamed is a load balancing name server written in Perl using the Stanford::\n  DNSserver perl module.  lbnamed allows you to create dynamic groups of hosts\n  that have one name in the DNS.  A host may be in multiple groups at the same\n  time. For example, the name\n\n    www.best.stanford.edu\n\n  represents a dynamic group of 5 web servers named:\n\n     www{1,2,3,4,5}.stanford.edu\n\n  When someone tries to connect to www.best.stanford.edu, a DNS query is\n  performed.  That query eventually gets sent to the lbnamed server which\n  responds with the name of the least loaded of those 5 web servers.\n\n  Of course advertising a web service in a subdomain like \"best.stanford.edu\"\n  is less than desirable.  Fortunately, that can be avoided with the simple\n  alias:\n\n    www.stanford.edu -\u003e www.best.stanford.edu\n\n  Now when someone tries to connect to www.stanford.edu and their DNS resolver\n  queries for the IP address of www.stanford.edu it gets the following answer:\n\n    www.stanford.edu       is an alias for  www.best.stanford.edu  (1)\n    www.best.stanford.edu  is an alias for  www3.stanford.edu      (2)\n    www3.stanford.edu      has address      171.64.10.89           (3)\n\n  In this \"alias chain\" type answer, the middle link, (2), is provided by\n  lbnamed; the others are provided by the normal name service serving the\n  \"stanford.edu\" zone.\n\n  lbnamed can return the address of the least loaded group member instead of\n  its name.  In that case, the query for the IP address of www.stanford.edu\n  would get the following answer:\n\n    www.stanford.edu       is an alias for  www.best.stanford.edu  (1)\n    www.best.stanford.edu  has address      171.64.10.89           (2)\n\n  This is somewhat less \"honest\", DNS-wise, because a reverse lookup on the\n  IP address yields the name www3.stanford.edu, not www.best.stanford.edu.\n  It does however avoid the \"alias chain\", which some older BIND versions\n  have trouble with (note that all those old BIND versions have security\n  problems, so no one should be running them now!).\n\n\n  Collecting and Summarizing Host Metrics\n  =======================================\n\n  The poller script queries the load-balanced client daemon, lbcd, on hosts\n  participating in load-balanced name groups.  It collects the system load\n  and other data from the lbcd running on each host (more on lbcd later).\n  The poller uses the collected information to calculate an overall \"weight\"\n  for each host.  The host names and weights are written to a file that the\n  lbnamed name server uses to determine which host names to pass out in\n  response to queries.\n\n  The poller calculates the weights using the following algorithm:\n\n    // constants\n\n    WEIGHT_PER_USER = 10\n    WEIGHT_PER_LOAD_UNIT = 3\n\n    // data retrieved from lbcd by the poller\n\n    l1   = current host load\n    tot  = total number of users logged into the host\n    uniq = number of unique users logged into the host\n\n    // data provided in the lbnamed configuration file\n\n    sf = this host's \"server factor\" in the range 0 to 10\n\n    weight = WEIGHT_PER_USER      * (0.2 * tot + 0.8 * uniq) * (10 - sf)\n           + WEIGHT_PER_LOAD_UNIT *          l1              *     sf\n\n  As you can see, the \"server factor\" controls the relative importance of\n  interactive user sessions.  A value of zero represents a purely interactive,\n  user-oriented host; a value of 10 represents a server with no logins.\n\n\n  Answering DNS Queries\n  =====================\n\n  The lbnamed script uses the weights calculated by the poller and the host\n  \"participation factors\" to determine which host's name to pass out in\n  response to a DNS query.  The participation factor is a configuration\n  parameter that allows for unequal load sharing between hosts in a group.\n\n  lbnamed sorts a group of hosts by (weight / participation factor) and passes\n  out the name of the host with the lowest value.  A host with a participation\n  factor of 0.10 would have to have a weight ten times that of a host with a\n  participation factor of 1.0 before they would sort equally.  A very small\n  participation factor, say 0.001, can be used to make one host a backup for a\n  set of other hosts with the default participation factor of 1.0.\n\n  Once lbnamed has determined which host's name to use in the DNS response,\n  it sends the response and increments the host's weight.  The increment is\n  calculated using the following formula:\n\n    // constants\n\n    WEIGHT_PER_USER = 10\n    WEIGHT_PER_LOAD_UNIT = 3\n\n    // data provided in the lbnamed configuration file\n\n    sf = this host's \"server factor\" in the range 0 to 10\n\n    increment = WEIGHT_PER_USER      * (10 - sf)\n              + WEIGHT_PER_LOAD_UNIT *    sf\n\n  Note that eventually all the hosts in a group will have the same weight and\n  their names will be passed out in round-robin fashion from then on.\n\n\n  TTLs and MXes\n  =============\n\n  By default, lbnamed uses TTL of 0 in its DNS responses.  That tells the DNS\n  not to cache the response and to always make a new query for the name in\n  question.  This gives the most accurate load sharing across the hosts in a\n  group.  But it may generate too many DNS queries.  If that's the case, you\n  can provide a non-zero TTL value for the group in the configuration file.\n  It's still best to keep the value small to promote a truly balanced load.\n\n  DNS queries for MX records must be handled in lbnamed for groups not using\n  the alias chain response type.  For those using the alias chain, the MX\n  response is \"inherited\" from the host's real name.  For example, an MX\n  query on www.stanford.edu might get the following alias chain answer:\n\n    www.stanford.edu       is an alias for     www.best.stanford.edu   (1)\n    www.best.stanford.edu  is an alias for     www3.stanford.edu       (2)\n    www3.stanford.edu      mail is handled by  10 leland.stanford.edu  (3)\n\n  As mentioned before, only link (2) comes from lbnamed, so it doesn't have to\n  handle the MX data.  But without the alias chain, the answer would be:\n\n    www.stanford.edu       is an alias for     www.best.stanford.edu   (1)\n    www.best.stanford.edu  mail is handled by  10 leland.stanford.edu  (2)\n\n  Once again part (2) is provided by the load-balanced name server, but this\n  time it's the MX record, so lbnamed must have the data to respond properly.\n  In order to support this, the lbnamed configuration file includes a section\n  where you may provide MX information.\n\n\n  Configuring lbnamed\n  ===================\n\n  lbnamed is configured using a configuration file.  The first section of the\n  file lists the names of the hosts and the names of the groups in which they\n  participate (remember that a group is a load-balanced name).  Each host also\n  has a server factor and a participation factor for each group it's in.  The\n  file may have an optional second section for listing load-balanced name TTLs\n  and MXes.  Here's a short sample configuration file:\n\n    # SF = server factor;     default participation factor = 1.0;\n\n    host                  SF  group(participation factor)\n    ####################  ##  #########################################\n    foo.stanford.edu       2  quux\n    bar.stanford.edu      10  www\n    baz.stanford.edu       5  quux www(.01)\n\n    # default TTL = 0 seconds;       top slice - see lbnamed POD;\n    # default MX  = none;\n\n    group           TTL  top slice   MX\n    ############  #####  #########   ##################\n    www               6          0   mail.stanford.edu\n\n\n  The Load-Balanced Client Daemon\n  ===============================\n\n  The load-balanced client daemon, lbcd, runs on the hosts participating in\n  load-balanced name groups.  The poller queries lbcd to get the host load\n  and other information.  lbcd is a mildly complex beast because it has to\n  understand how to get all that information from a plethora of Unix\n  variants.  Because of that complexity, lbcd is distributed and maintained\n  separately from lbnamed.\n\n  If lbcd doesn't support your flavor of Unix, or round-robin satisfies your\n  load-balancing needs, or you just want to play with lbnamed without down-\n  loading lbcd, this package does include slbcd, a static/simple load-balanced\n  client daemon.  slbcd is written in perl.  It provides a complete lbcd with\n  hard-coded values for the load and other data.  When you run it on the hosts\n  participating in a load-balanced name group, they will always have the same\n  weight and therefore their names will always be passed out in round-robin\n  fashion.\n\n\n  Duh\n  ===\n\n  The lbnamed and lbnamed.config files in this package contain Stanford-\n  specific configuration data.  Unless you're going to run a load-balanced\n  name service for Stanford, you'll want to edit those files replacing that\n  data with values appropriate for your DNS domain.\n\n\n  Conclusion\n  ==========\n\n  Hopefully this has been enough of an introduction to lbnamed that you can\n  make it work for you.  Be sure to check out the POD documentation for both\n  lbnamed and the poller, and the sample configuration file, lbnamed.config.\n\n  Share and enjoy.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaltri%2Fpackaging-lbnamed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaltri%2Fpackaging-lbnamed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaltri%2Fpackaging-lbnamed/lists"}