Re: Image upload -> manipulation -> copy to S3

2010-09-28 Thread Paul Cortens
On Sep 28, 11:12 am, Idris  wrote:
> Why not just upload the file straight to S3 (I recommend not going
> through paperclip, but instead going straight to S3, so you don't hold
> up the dyno).  Then when the upload finishes, kick off a background
> job to read the image off S3, process it, and save the processed
> image.

This is exactly what I'd recommend if you want something scalable.
There are a few flash-based plugins that will even let you upload
directly to S3 so your dyno is not tied up. I have used this to allow
users to upload videos.

That said, if you are just dealing with images, setting up direct-to-
s3 uploading (and all the callbacks and background processing
associated with it) can be way too much development time.
It won't scale, but for small-to-medium sites, using paperclip and
having the dyno resize your images then upload to S3 will work just
fine.

Paul

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



Re: Image upload -> manipulation -> copy to S3

2010-09-28 Thread Idris
Why not just upload the file straight to S3 (I recommend not going
through paperclip, but instead going straight to S3, so you don't hold
up the dyno).  Then when the upload finishes, kick off a background
job to read the image off S3, process it, and save the processed
image.

On Sep 28, 12:07 am, Oren Teich  wrote:
> > 1) With Heroku I understand your request can have some temporary space
> > for file uploads. Can I rely on that space to exist for a few minutes
> > while a Delayed Job gets to it?
>
> The space is for the request.  A delayed job will run as a seperate
> process, so no, you can't count on it being there.  Chances are high
> that the delayed job will run on a different machine, and not have
> access to the file.
>
> Note that for small files, you can have the dyno upload to s3 as part
> of the process.  Paperclip supports this out of the box.  I have sites
> myself working this way.
>
>
>
> > 2) Does uploading a file completely lock a dyno?  Or can a single dyno
> > handle a few simultaneous uploads?
>
> A dyno is by definition one simultaneous request.  That dyno is locked
> for the duration of the upload.
>
> Oren

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



Re: Image upload -> manipulation -> copy to S3

2010-09-27 Thread Oren Teich
>
> 1) With Heroku I understand your request can have some temporary space
> for file uploads. Can I rely on that space to exist for a few minutes
> while a Delayed Job gets to it?


The space is for the request.  A delayed job will run as a seperate
process, so no, you can't count on it being there.  Chances are high
that the delayed job will run on a different machine, and not have
access to the file.

Note that for small files, you can have the dyno upload to s3 as part
of the process.  Paperclip supports this out of the box.  I have sites
myself working this way.


>
> 2) Does uploading a file completely lock a dyno?  Or can a single dyno
> handle a few simultaneous uploads?

A dyno is by definition one simultaneous request.  That dyno is locked
for the duration of the upload.

Oren

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