Jake McArthur successfully answered Don Miguel de los Platanos's question:

I have a rails app that runs an nmap scan on a host and reports the response via ajax. I use backtick to run nmap via my controller. What I've noticed is that if the nmap scan takes a while (say about 2 minutes), rails will block all request until the shell command finishes executing. My question is if there is a more effecient way to run shell commands via rails? Will I have to thread the nmap scan so the rails controller doesn't block until it receives a response?

People succeed in answering Don Miguel de los Platanos's questions 42% of the time (8 successes in 19 attempts).

Answers by: Jake McArthur

Jake McArthur's Answer:

Reply by Jake McArthur 712 days ago

Use a load balancer and Mongrel or FastCGI on your production server to allow for multiple things to happen at once.

Reply by Jake McArthur 712 days ago

I stated that too simply. A load balancer can be anything from lighttp to Apache to an actual dedicated load balancer, and FastCGI or Mongrel or other should run under that. There are many tutorials for this on the web.

Reply by Don Miguel de los Platanos 712 days ago

I think I understand where you going with this. Just post some tutorials and I'll send the reward over.

Reply by Don Miguel de los Platanos 712 days ago

Some more info would be appreciated. Thanks.

Reply by Jake McArthur 711 days ago

http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/

The above link is a guide to getting a full production server up and running with Rails, a Mongrel cluster (basically just runs multiple instances of your Rails app, but on the same database of course), Apache (the server and load balancer), and Capistrano (basically assists in setting up a production server).

Reply by Don Miguel de los Platanos 711 days ago

Thanks. I got it running now.