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

Speed and accuracy improvements surrounding import --replace operations #75

Closed
wants to merge 7 commits into from

Conversation

goekesmi
Copy link

I picked up cli53 to handle syncing from a legacy system to AWS Route53.

Attempts to sync my zone file, which the cut down minimal one is 22k RR's resulted in hilariously long run times (82 minutes of CPU), and needless replacement of some record types (MX records coming back in a different order than in the local zone file).

I'm not a python programmer. I've hit this code with a hammer to make it run acceptably in my environment.
Run time on my zone is down to 51 seconds wall clock, 18 seconds cpu.

Consider this, if not reasonable patches, at least suggestions on how to make it run faster. Dig around in my branch history if you want the bits for the problems as isolated chunks.

Thanks.

On rr's that have more than one entry, for example MX records, the
order they are in the zone file may not match the order they are in
the the AWS pull of the record.  This leads to needless deletes and
adds when doing an import --replace.
The original algorithm went O(n^2) during the comparison.  This resulted
in hilariously long runtimes for moderate sized zones.  This crudely smashes
a hash table (dict to be exact) into the process, dramatically reducing the
comparison time.
Conflicts:
	scripts/cli53
@barnybug
Copy link
Owner

barnybug commented Apr 1, 2014

Thanks for this, it's great to have it tested to this scale. Your code is almost there, I'll tweak it a bit and push the changes to master this week. Thanks again.

@barnybug barnybug closed this in d7007f1 Apr 2, 2014
@goekesmi
Copy link
Author

goekesmi commented Apr 4, 2014

FWIW, I've picked up your code and run it in my test environment. It's run time is within epsilon of my version, so I'm adopting your implementation.

Thanks for hammering it into acceptable python, and integrating it into mainline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants