S3 timeouts?

284 views
Skip to first unread message

nader

unread,
Dec 2, 2010, 2:20:32 PM12/2/10
to carrierwave
Hey everyone, my app is hosted on Heroku. About 10% of the time when
I upload an image to S3, the request just hangs for 15 minutes,
locking up that Heroku dyno. Has anyone else experienced this?

Samuel Lown

unread,
Dec 2, 2010, 2:40:42 PM12/2/10
to carri...@googlegroups.com
Hi Nader,

Yes, in fact I recently helped out a project were this was happening
and causing lots of damage. I'd expect it to be an S3 issue as opposed
to a CarrierWave bug (but I'm out of touch with the latest S3
uploading changes!)

The solution I ended up putting in place was to use delayed_job and
upload the file in the background using manual Timeouts to restart if
uploading failed after 30s. This is recommended anyway as its not a
good idea to block dynos or mongrels while uploading stuff.

Maybe Rackspace's Cloud Files is more reliable?

Good luck!
sam

> --
> You received this message because you are subscribed to the Google Groups "carrierwave" group.
> To post to this group, send email to carri...@googlegroups.com.
> To unsubscribe from this group, send email to carrierwave...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/carrierwave?hl=en.
>
>

--
www.samlown.com
www.autofiscal.com
www.planetaki.com/sam

nader

unread,
Dec 2, 2010, 3:25:30 PM12/2/10
to carrierwave
Hi Sam, that sounds like the healthiest way to handle it. Did you
modify the Carrierwave S3 storage class? Would you care to share that
change?

Cheers,
Nader

On Dec 2, 11:40 am, Samuel Lown <sam.l...@gmail.com> wrote:
> Hi Nader,
>
> Yes, in fact I recently helped out a project were this was happening
> and causing lots of damage. I'd expect it to be an S3 issue as opposed
> to a CarrierWave bug (but I'm out of touch with the latest S3
> uploading changes!)
>
> The solution I ended up putting in place was to use delayed_job and
> upload the file in the background using manual Timeouts to restart if
> uploading failed after 30s. This is recommended anyway as its not a
> good idea to block dynos or mongrels while uploading stuff.
>
> Maybe Rackspace's Cloud Files is more reliable?
>
> Good luck!
> sam
>

Samuel Lown

unread,
Dec 2, 2010, 3:59:05 PM12/2/10
to carri...@googlegroups.com
I didn't alter anything in Carrierwave, its just a question of setting
up delayed_job or something similar and using the ruby time out class
when you store the file.

I should mention, we were generating PDFs rather than receiving files
from users. Might be a bit more difficult if you're dealing with
user-uploaded content, especially given that Heroku doesn't provide
any type of reliable temporary storage...

Cheers,
sam

Kevin Ansfield / Looking Sideways

unread,
Dec 2, 2010, 3:32:22 PM12/2/10
to carrierwave
Hi Samuel,

I've just started hitting this issue too. With your delayed jobs, do
you have to perform processing as well? I was concerned that the temp
file system on Heroku may not be the best place to have images waiting
around to get processed, especially if a worker gets hung up!

Cheers,
Kevin


On Dec 2, 7:40 pm, Samuel Lown <sam.l...@gmail.com> wrote:
> Hi Nader,
>
> Yes, in fact I recently helped out a project were this was happening
> and causing lots of damage. I'd expect it to be an S3 issue as opposed
> to a CarrierWave bug (but I'm out of touch with the latest S3
> uploading changes!)
>
> The solution I ended up putting in place was to use delayed_job and
> upload the file in the background using manual Timeouts to restart if
> uploading failed after 30s. This is recommended anyway as its not a
> good idea to block dynos or mongrels while uploading stuff.
>
> Maybe Rackspace's Cloud Files is more reliable?
>
> Good luck!
> sam
>

nader

unread,
Dec 7, 2010, 5:53:54 PM12/7/10
to carrierwave
Yeah I don't think this works for user uploaded images as there is no
where reliable to cache the files so that they're available to the
delayed job worker.

Given that constraint, it seems like the right way to handle this is
to do the upload without delayed job, but still within a Timeout. The
versions could be processed by delayed job after the initial upload to
S3, by retrieving it from S3 to process. But I'm not sure I want to
mess with Carrierwave that significantly

On Dec 2, 12:32 pm, "Kevin Ansfield / Looking Sideways"

Trevor Turk

unread,
Dec 21, 2010, 10:43:40 AM12/21/10
to carri...@googlegroups.com
On Tuesday, December 7, 2010 10:53:54 PM UTC, nader wrote:
Given that constraint, it seems like the right way to handle this is
to do the upload without delayed job, but still within a Timeout.  

I'm curious if you (or anyone else) has implemented this yet. I'm running into this problem with Heroku's lack of temporary storage now as well. 

- Trevor
 
Reply all
Reply to author
Forward
0 new messages