Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveResource does not support keep-alive connections

#1513

ActiveResource::Connection sets up and tears down a new connection each time a request is performed. If the rails application performs multiple subsequent requests, this leads to immense performance degradation.

I have found the private http() method of ActiveResource::Connection to be the culprit. The method creates a new Net::HTTP object and returns it. When a request is performed with this object, the connection is opened and then immediately closed afterwards.

Instead, the method start() could be called on the object, and the object stored as a private instance variable. This way, the same open connection could be used for multiple subsequent requests.

The Rails version I use is 2.2.0

Reported by Kristoffer Paro · December 3rd, 2008 @ 01:29 PM

State: wontfix
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to wontfix
    • Assigned user set to Pratik

    March 13th, 2009 @ 02:44 PM