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


source to share





All Articles