Why is loading so slow with CarrierWave and Rackspace Cloudfiles?

I am using CarrierWave to load images and it takes 3-5 seconds to load (during production) using Rackspace Cloudfiles as storage. I first explained that my image processor is slow or awkward or whatever; so I switched from RMagick to Vips ... No noticeable change in speed.

For more information, I decided to write a new Relic tool:

http://github.com/tehprofessor/newrelic-carrierwave

After using the toolkit, New Relic reports that the majority of requests (85% on average) are consumed internally:

::CarrierWave::Storage::Fog::File#store

      

The #store method is called multiple times, sometimes the first is slow, sometimes the last, sometimes all of them. On average, a #store fast call completes in about 234ms.

I am currently doing 5 versions; each of which ends in less than 10ms (for image processing). Source files are between 100k and 500k.

In short, this is definitely something with posting to Rackspace. Nothing to do with an image library.

My CarrierWave configuration

CarrierWave.configure do |config|
    config.fog_credentials = {
        :provider           => 'Rackspace',
        :rackspace_username => 'SECRET_SAUCE',
        :rackspace_api_key  => 'CHEESEBURGER',
        :rackspace_servicenet => true
    }
    config.storage = :fog
end

      

I contacted Rackspace and their support suggested using Curl. The support auditor who "tried" to help me found Curl's use of cloud files to be fast. I found this to be particularly useful, and in stark contrast to what my new relic has to offer.

In addition, the containers I use are public and located in the same data center as our cloud servers (VPS).

At this point, I hardly understand why it is so damn slow; especially since I have the servicenet set installed, and the container and servers are located in the same data center. If anyone has any suggestions or ideas that I would like to hear ...

Perhaps I just did something very stupid or missed a configuration option? Any help is greatly appreciated!

Update : after a year this is still a problem; although not so bad ... maybe Rackspace changed something?

Thanks, Seve

+3
ruby-on-rails rackspace carrierwave fog cloudfiles


source to share


No one has answered this question yet

Check out similar questions:

8
Why does it take so long to get the url of a file from S3 using CarrierWave and Fog?
2
Fog :: Storage :: Rackspace :: NotFound error when using Carrierwave to upload to Rackspace
2
Carrierwave / fog undefined 'gsub' method for # <array: 0x000001067d4798>
2
Why won't Carrierwave and MiniMagick images render correctly?
1
Carrier file upload from Rackspace cloud files not working
1
Using Cloud RackSpace Files with Paperclip Gem
1
Rails 3 - CarrierWave and CloudFiles are extremely slow
0
Cloudfiles API with SNET set to true seems to be very slow
0
How to Protect One Version of an Open Access Carrier Image on Amazon S3
0
How to upload images to Rackspace Cloud Files using rake function?



All Articles
Loading...
X
Show
Funny
Dev
Pics