XCP-ng

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    DNS queries during backup job

    Xen Orchestra
    6
    27
    407
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Andrew Top contributor 💪 @Forza last edited by

      @Forza I agree that the OS is responsible for caching host records. The real question is why is XO doing so many lookups repeatedly. Maybe it is actually a Node problem (in addition to code issues).

      In most applications once a socket is opened to a host it stays open and does not need to do another lookup until it is closed and a new connection is made. If XO or Node is stateless and opens a new connection for each block read/write (or group of blocks) then it may do a lot of lookups. The mass lookups seems to be a sign of a lot of overhead that could be reduced to improve performance.

      Yes, nscd can be a host query (DNS) cache solution (for XO source and XOA) but can the code be improved to reduce overhead and improve general performance?

      Here is a quick MRTG image of DNS requests. You can see when I enabled nscd that caches lookup requests (hint, sunday night):
      dns-requests-week.jpg

      olivierlambert 1 Reply Last reply Reply Quote 2
      • olivierlambert
        olivierlambert Vates 🪐 Founder & CEO 🦸 @Andrew last edited by

        @Andrew said in DNS queries during backup job:

        If XO or Node is stateless and opens a new connection for each block read/write (or group of blocks) then it may do a lot of lookups. The mass lookups seems to be a sign of a lot of overhead that could be reduced to improve performance.

        I agree that's a good question (for @julien-f I assume)

        1 Reply Last reply Reply Quote 1
        • ronivay
          ronivay Top contributor 💪 @julien-f last edited by

          @julien-f this changed the situation from thousands of queries in minutes to no noticeable spike in query graphs during backup job, so huge improvement.

          1 Reply Last reply Reply Quote 1
          • H
            hoerup last edited by

            Although it is nice that there is work arounds for the DNS spikes with either nscd or the in-process DNS cache, i think the DNS spikes are a symptom of a whole different issue.

            I think we can safely assume that each DNS lookup is corresponding to one attempt at establishing a TCP connection then there is some code somewhere that spawns an awfull lot of short lived connections instead of reusing / pooling them - with all the issues that follows in that area (insufficient ulimit NOFILE, connections in TIME_WAIT/exhausting of client ports etc)

            julien-f 1 Reply Last reply Reply Quote 2
            • julien-f
              julien-f Vates 🪐 XO Team 🔭 @hoerup last edited by

              @hoerup I agree with your analysis, not sure how easy it will be to fix, we'll investigate.

              1 Reply Last reply Reply Quote 0
              • ronivay
                ronivay Top contributor 💪 last edited by

                Did some further testing if amount of DNS queries would correlate to the amount of actual connections made to the host. This doesn't seem to be the case which is even more interesting 🙂 Some results below.

                Ran an incremental from delta backup which took in total of 9 minutes:

                • Amount of DNS queries: close to 7k
                • Amount of HTTPS connects logged to host IP-address: 478.
                • Amount of HTTPS connects/disconnects logged in total to host IP-address: 955

                Connection counts were about the same with installation from dns.lookup branch provided by @julien-f above, without the amount of DNS queries obviously.

                Forza 1 Reply Last reply Reply Quote 2
                • Forza
                  Forza @ronivay last edited by

                  @ronivay are all dns queries for the same host and record?

                  ronivay 1 Reply Last reply Reply Quote 0
                  • ronivay
                    ronivay Top contributor 💪 @Forza last edited by ronivay

                    Yep. Same domain, asks A and AAAA at the same time, both being individual queries obviously.

                    1 Reply Last reply Reply Quote 0
                    • olivierlambert
                      olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

                      Also XAPI (so on host side) doesn't support HTTP/2.

                      julien-f 1 Reply Last reply Reply Quote 0
                      • julien-f
                        julien-f Vates 🪐 XO Team 🔭 @olivierlambert last edited by

                        The DNS cache has been merged, keep us posted if you have any issues. 🙂

                        1 Reply Last reply Reply Quote 2
                        • First post
                          Last post