snacktime wrote:
>>
>> What do you mean by the DNY lookup is asynchronous and will block my
>> process? If I was to call curl directly from the command line using
>> `curl` in ruby wouldn't that be much faster. In this instance it wo uld
>> get it's own process and take better advantage of a dual processor
>> system. Am I correct, because what I planned on doing was just using
>> curl directly from the command line unless there is a downside to this.
>>
> 
> From my understanding dns lookups block in ruby, as in they stop the
> whole program until the dns is resolved.  I can't imagine that forking
> another process would be more efficient then using net/http.

In my program each curl request would be in its own thread. I also think 
the forking a new process by using `` would be quicker. Mainly because I 
am doing this on a dual processor server. Having everything run under 
one process doesn't take advantage of that. Lastly, curl has a timeout 
variable, so if for some reason the request didn't response it would 
time out. I also noticed that running curl and Net::HTTP side by side, 
curl wins hands down. There is even a hitch right before the request is 
made in Net::HTTP, about .5 to 1 second.

Am I wrong here?

What I'm going to do is probably implement the curl functionaltiy in my 
program and post the speed differences for future reference. Unless 
someone tells me I'm about going about this all wrong.

Thanks a lot for everyones help.

-- 
Posted via http://www.ruby-forum.com/.