# Resolv-replace problem

**URL:** <https://www.ruby-forum.com/t/resolv-replace-problem/82999>\
**Category:** Ruby\
**Created:** [January 22, 2007, 11:45pm UTC](https://www.ruby-forum.com/t/resolv-replace-problem/82999 "2007-01-22T23:45:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mly](https://www.ruby-forum.com/u/mly)\
**Post date:** [January 22, 2007, 11:45pm UTC](https://www.ruby-forum.com/t/resolv-replace-problem/82999/1 "2007-01-22T23:45:06Z")

</div>

After running through aproximately 512 ip to name resolutions, the  
resolv-replace library seems to become very slow and starts blocking  
threads. Any ideas?

Any good alternatives for doing ip address to name lookups on thousands  
of  
systems?

– Matt  
It’s not what I know that counts.  
It’s what I can remember in time to use.

---

<div class="post-metadata">

**Author:** ![mly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mly](https://www.ruby-forum.com/u/mly)\
**Post date:** [January 22, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/resolv-replace-problem/82999/2 "2007-01-22T23:55:08Z")

</div>

On Tue, 2007-01-23 at 07:44 +0900, Matt L. wrote:

> Any good alternatives for doing ip address to name lookups on thousands of  
> systems?

You could have a look at Ruby/Cares[[http://cares.rubyforge.org/](http://cares.rubyforge.org/)]. It’s a  
wrapper for c-ares, a library that performs name-resolving  
asynchronously.

Feedback welcome 🙂

Best regards,  
Andre

---

<div class="post-metadata">

**Author:** ![mly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mly](https://www.ruby-forum.com/u/mly)\
**Post date:** [January 23, 2007, 12:50am UTC](https://www.ruby-forum.com/t/resolv-replace-problem/82999/3 "2007-01-23T00:50:21Z")

</div>

On Jan 22, 2007, at 14:44, Matt L. wrote:

> After running through aproximately 512 ip to name resolutions, the  
> resolv-replace library seems to become very slow and starts  
> blocking threads. Any ideas?
> 
> Any good alternatives for doing ip address to name lookups on  
> thousands of systems?

I’ve experienced this problem and assumed it was due to resolv-  
replace waiting for the destination name servers to time out, but  
didn’t verify. Have you examined this possibility?

If you’ve got 1000 bogus host names, 100 threads and a 30 second  
timeout per thread you’ll still wait at least 5 minutes for all of  
them to fail to resolve.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)

I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![mly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mly](https://www.ruby-forum.com/u/mly)\
**Post date:** [January 23, 2007, 12:57am UTC](https://www.ruby-forum.com/t/resolv-replace-problem/82999/4 "2007-01-23T00:57:22Z")

</div>

On Tue, 23 Jan 2007, Eric H. wrote:

> Have you examined this possibility?
> 
> If you’ve got 1000 bogus host names, 100 threads and a 30 second timeout per  
> thread you’ll still wait at least 5 minutes for all of them to fail to  
> resolve.

Shouldn’t have to wait for all of the lookups to fail. Every time EACH  
lookup fails, the threads should continue. I have a limit in my program  
of 50 threads. After about 512 lookups, the number of threads goes from  
50 active to 6 or 7 active. Even when using the same address range over  
and over.

– Matt  
It’s not what I know that counts.  
It’s what I can remember in time to use.
