[acassen/keepalived] 9d028a: Reduce number of calls to getaddrinfo() reducing D...

Alexandre Cassen <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <56e14f9d4d14f_6d283fc197ed72c01647b5@hookshot-fe3-cp1-prd.iad.github.net.mail>
  Branch: refs/heads/master
  Home:   https://github.com/acassen/keepalived
  Commit: 9d028acd327e722e6692eaa9d47e3914e16edf3a
      https://github.com/acassen/keepalived/commit/9d028acd327e722e6692eaa9d47e3914e16edf3a
  Author: Quentin Armitage <[email protected]>
  Date:   2016-03-09 (Wed, 09 Mar 2016)

  Changed paths:
    M doc/keepalived.conf.SYNOPSIS
    M doc/man/man5/keepalived.conf.5
    M keepalived/core/global_data.c
    M keepalived/core/global_parser.c
    M keepalived/core/smtp.c
    M keepalived/include/global_data.h
    M keepalived/vrrp/vrrp.c

  Log Message:
  -----------
  Reduce number of calls to getaddrinfo() reducing DNS lookups

Issue #199 identified that keepalived could be very slow to start up
if DNS queries resolving the local host name were very slow.

keepalived could call get_local_name() twice at startup for each of the
vrrp and checker threads, in order to get the router_id and also the
set the default email_from address, unless these were manually configured.
It also called getaddrinfo() for the local host name every time it sent an
email, in order to set the HELO string.

This commit reduces the total number of calls per thread to one, using
the returned name to set the router_id, email_from address and the HELO
name (which is now saved for reuse every time an email is sent).

In order to allow no DNS lookups to be made, an extra global configuration
parameter is introduced, smtp_helo_name, so that if router_id, smtp_email_from
and smtp_helo_name are all set in the configurationi (and also the smtp_server
is specified by IP address rather than by name), then no DNS queries will
be made.

Signed-off-by: Quentin Armitage <[email protected]>


  Commit: 4a41bd64da0964e38a45ddd1e151582ce6ec7787
      https://github.com/acassen/keepalived/commit/4a41bd64da0964e38a45ddd1e151582ce6ec7787
  Author: Alexandre Cassen <[email protected]>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M doc/keepalived.conf.SYNOPSIS
    M doc/man/man5/keepalived.conf.5
    M keepalived/core/global_data.c
    M keepalived/core/global_parser.c
    M keepalived/core/smtp.c
    M keepalived/include/global_data.h
    M keepalived/vrrp/vrrp.c

  Log Message:
  -----------
  Merge pull request #270 from pqarmitage/fixes

Reduce number of calls to getaddrinfo() reducing DNS lookups


Compare: https://github.com/acassen/keepalived/compare/c724860a1455...4a41bd64da09

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.