Topic: AJAX Performance problem

I've just added some ajax to a web site I have and I'm seeing HUGE delays on 'submit' of the ajax form.  Seems to happen every time and the traffic on the site is not huge, though growing.

Here is a snippet from the prod log:
Completed in 17937ms (View: 17922, DB: 11) | 200 OK [http://www.mentorworks.com/mentor_offer … neur_id=89]

Here is the form where I make the call into the controller:

<% form_remote_for :offer, :url => { :controller => 'mentor_offers', :action => 'create_offer', :id => offer, :entrepreneur_id => entrepreneur.id }, :method => :post do |f| %>

  <div class="notice">
  <div><%= f.submit "Save" %> | <%= link_to_remote('Cancel', :url => { :controller => 'mentor_offers', :action => 'close_new', :entrepreneur_id => entrepreneur.id }, :class => "nav_ctl") %></div>

<% end %>


I've search around a bit but have not seen anything that's an obvious gotcha with this code.

Any help would be appreciated.
Mark


... so its all in the view, about 17 seconds delay.

Last edited by mkrx (2009-05-09 11:30:05)

Re: AJAX Performance problem

The bottleneck must be your server since the AJAX call is made from your PC to the server-side script. Or am I misunderstanding the problem? What's the load average on your server when you notice the slowness?

Best

FULLY managed everything because we care.
Dedicated Servers at UNIXy - https://www.unixy.net
Virtual Private Servers at VPSLux - http://www.vpslux.com
joe@unixy.net. Feel free to get in touch. I unsubscribe from threads overnight.