[Rails] large file storing in postgres sucks?
Robby Russell
robby.lists at planetargon.com
Mon May 1 01:24:37 GMT 2006
On Apr 30, 2006, at 6:04 PM, Joe Van Dyk wrote:
> Hi,
>
> I'm not sure if this is a postgres issue or not, but I'm using
> Postgres 8.1. I have (in my functional tests) the following code:
>
> upload = fixture_file_upload('/files/podcast.mp3', 'audio/mpeg')
> post :create, :product => valid_product, :media => { :image =>
> upload }
>
> And then in the controller:
> blob = Blob.create :data => uploaded_file.read
>
> When /files/podcast.mp3 is 32 megabytes and I run the test, memory
> spikes hugely. My laptop quickly began swapping out memory and became
> unusable. top showed the memory usage of the Ruby process to be about
> 400MB and growing.
>
> Is there something stupid that I'm doing?
Are you using a blob field type rather than the postgresql large
objects?
-Robby
Robby Russell
Founder & Executive Director
PLANET ARGON, LLC
Ruby on Rails Development, Consulting & Hosting
www.planetargon.com
www.robbyonrails.com
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4968 [fax]
More information about the Rails
mailing list