# Ajax and performance

**URL:** <https://www.ruby-forum.com/t/ajax-and-performance/88953>\
**Category:** Rails\
**Created:** [March 15, 2007, 9:30pm UTC](https://www.ruby-forum.com/t/ajax-and-performance/88953 "2007-03-15T21:30:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pypypy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5daacb/32.png) [@pypypy](https://www.ruby-forum.com/u/pypypy)\
**Post date:** [March 15, 2007, 9:30pm UTC](https://www.ruby-forum.com/t/ajax-and-performance/88953/1 "2007-03-15T21:30:32Z")

</div>

Hello,

I got this newbye problem :

1 method is very long to process and CPU consuming.  
So, i want to add a progress bar.

But when i call this heavy method, then the entire rails application is  
frozen until it finished.  
So the ajax call for progression status does not get any response from  
the server until the method is finished…

I tryed with Webrick and Apache + mod\_scgi with the same result.

Is there a way to make it multi thread to process multiple requests in  
the same time ?  
Does i have to create a cluster or a kind of ruby worker pool to handle  
several requests in the same time ?  
Is there a way to ‘renice’ a method ?

Am i missing somethings ?

Any ideas is welcome 🙂

Thank you in advance

---

<div class="post-metadata">

**Author:** ![pypypy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5daacb/32.png) [@pypypy](https://www.ruby-forum.com/u/pypypy)\
**Post date:** [March 15, 2007, 10:04pm UTC](https://www.ruby-forum.com/t/ajax-and-performance/88953/2 "2007-03-15T22:04:36Z")

</div>

Rails is not thread safe so your choices are multiple web server  
processes or use of something like [http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/)

Michael

---

<div class="post-metadata">

**Author:** ![pypypy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5daacb/32.png) [@pypypy](https://www.ruby-forum.com/u/pypypy)\
**Post date:** [March 16, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/ajax-and-performance/88953/3 "2007-03-16T17:03:53Z")

</div>

MichaelLatta wrote:

> Rails is not thread safe so your choices are multiple web server  
> processes or use of something like [http://backgroundrb.rubyforge.org/](http://backgroundrb.rubyforge.org/)
> 
> Michael

Thank you Michael,

Will Rails be thread safe one day ?  
This basic feature is really missing to me…  
py
