Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving Performance Improvements #397

Open
mageddo opened this issue Mar 23, 2023 · 0 comments
Open

Resolving Performance Improvements #397

mageddo opened this issue Mar 23, 2023 · 0 comments
Labels
secondary-feature A low priority feature

Comments

@mageddo
Copy link
Owner

mageddo commented Mar 23, 2023

Pre-load docker containers hostnames

Noticed 50% of the query time is spent by trying to solve docker containers, the process to check if any container matches to a given hostname is composed of many steps,

It would be faster if DPS watch for docker container events instead of query docker hostnames using the docker api for every dns query.

Logs

23:21:59.466 [Thread-14      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=45   m=solve                           status=solveReq, kind=udp, query=query=A:uol.com.br
23:21:59.490 [Thread-14      ] DEB c.m.d.server.dns.solver.SolverCachedRemote        l=32   m=lambda$handle$0                 status=remoteHotLoading, query=query=A:uol.com.br
23:21:59.509 [Thread-14      ] DEB c.m.dnsproxyserver.server.dns.solver.SolverCache  l=46   m=lambda$handleRes$0              status=hotload, k=A-uol.com.br, ttl=PT5M, simpleMsg=query=A:uol.com.br
23:21:59.509 [Thread-14      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=84   m=solve0                          status=solved, currentSolverTime=20, totalTime=43, solver=SolverCachedRemote, req=query=A:uol.com.br, res=rc=0, res=uol.com.br.    43  IN  A  200.147.35.149
23:21:59.509 [Thread-14      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=99   m=solve0                          status=solveSummary, summary=[(SolverSystem,0), (SolverDocker,22), (SolverLocalDB,1), (SolverCachedRemote,20)]
23:21:59.509 [Thread-14      ] DEB c.m.dnsproxyserver.server.dns.solver.SolverCache  l=46   m=lambda$handleRes$0              status=hotload, k=A-uol.com.br, ttl=PT20S, simpleMsg=query=A:uol.com.br
23:21:59.509 [Thread-14      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=50   m=solve                           status=solveRes, kind=udp, time=43, res=rc=0, res=uol.com.br.    43  IN  A  200.147.35.149, req=query=A:uol.com.br
23:21:59.510 [Thread-14      ] DEB com.mageddo.dnsproxyserver.server.dns.UDPServer   l=58   m=handle                          status=success, query=query=A:uol.com.br, res=rc=0, res=uol.com.br.    43  IN  A  200.147.35.149, serverAddr=/0:0:0:0:0:0:0:0, clientAddr=/192.168.0.128:39531, dataLength=512, datagramLength=28
23:21:59.510 [Thread-15      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=45   m=solve                           status=solveReq, kind=udp, query=query=AAAA:uol.com.br
23:21:59.523 [Thread-15      ] DEB c.m.d.server.dns.solver.SolverCachedRemote        l=32   m=lambda$handle$0                 status=remoteHotLoading, query=query=AAAA:uol.com.br
23:21:59.542 [Thread-15      ] DEB c.m.dnsproxyserver.server.dns.solver.SolverCache  l=46   m=lambda$handleRes$0              status=hotload, k=AAAA-uol.com.br, ttl=PT5M, simpleMsg=query=AAAA:uol.com.br
23:21:59.542 [Thread-15      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=84   m=solve0                          status=solved, currentSolverTime=19, totalTime=31, solver=SolverCachedRemote, req=query=AAAA:uol.com.br, res=rc=0, res=uol.com.br.    9  IN  AAAA  2804:49c:3102:401:ffff:ffff:ffff:36
23:21:59.542 [Thread-15      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=99   m=solve0                          status=solveSummary, summary=[(SolverSystem,0), (SolverDocker,11), (SolverLocalDB,1), (SolverCachedRemote,19)]
23:21:59.542 [Thread-15      ] DEB c.m.dnsproxyserver.server.dns.solver.SolverCache  l=46   m=lambda$handleRes$0              status=hotload, k=AAAA-uol.com.br, ttl=PT20S, simpleMsg=query=AAAA:uol.com.br
23:21:59.542 [Thread-15      ] DEB c.m.d.server.dns.RequestHandlerDefault            l=50   m=solve                           status=solveRes, kind=udp, time=32, res=rc=0, res=uol.com.br.    9  IN  AAAA  2804:49c:3102:401:ffff:ffff:ffff:36, req=query=AAAA:uol.com.br
23:21:59.543 [Thread-15      ] DEB com.mageddo.dnsproxyserver.server.dns.UDPServer   l=58   m=handle                          status=success, query=query=AAAA:uol.com.br, res=rc=0, res=uol.com.br.    9  IN  AAAA  2804:49c:3102:401:ffff:ffff:ffff:36, serverAddr=/0:0:0:0:0:0:0:0, clientAddr=/192.168.0.128:49244, dataLength=512, datagramLength=28

Caches the LocalDB

Caches the localdb and store it in a model of key value, will also help to increase performance and reduce disk load usage.

References to watch file changes so the cache can be automatically updated

@mageddo mageddo added the secondary-feature A low priority feature label Mar 23, 2023
@mageddo mageddo changed the title Performance Improvement: Pre-load docker containers hostnames Resolving Performance Improvements Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
secondary-feature A low priority feature
Projects
None yet
Development

No branches or pull requests

1 participant