I have a simple application that receives POSTed images via the API and sends them to S3 via Carrierwave. The My Photos table also has counter_cache.
In 80% of cases, my transaction time is HUGE, for example 60 seconds or more, and more than 90% of this time is spent uploading an image to S3 and updating counter_cache.
Does anyone know why this loading time is so long and why cache request requests take so long?



Just added some photos at http://carrierwave-s3-upload-test.herokuapp.com
The behavior was similar: 
Just removed counter_cache from my code and made a few more downloads .... Odd behavior again. 
EDIT 1
Logs of the latest package download. EXCON_DEBUG is True: https://gist.github.com/rafaelcgo/561f516a85823e30fbad
EDIT 2
My logs did not display EXCON information. Therefore, I realized that I used fog 1.3.1. Updated to Fog 1.19.0 (which uses the newer version of excon gem) and now everything works fine. 
Tips .. If you need to debug external connections, use the newer version of excon and set env EXCON_DEBUG = true to see some detailed ones, for example: https://gist.github.com/geemus/8097874
EDIT 3
Guys updated the gem fog and now it's sweet. I don't know why older versions of fog and excon have this odd performance.
amazon-s3 heroku carrierwave excon
Rafael oliveira
source share