# Is Amazon s3 always this slow?

**URL:** <https://www.ruby-forum.com/t/is-amazon-s3-always-this-slow/134636>\
**Category:** Rails\
**Created:** [April 13, 2008, 7:27am UTC](https://www.ruby-forum.com/t/is-amazon-s3-always-this-slow/134636 "2008-04-13T07:27:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [April 13, 2008, 7:27am UTC](https://www.ruby-forum.com/t/is-amazon-s3-always-this-slow/134636/1 "2008-04-13T07:27:19Z")

</div>

This is what I get in the log files when accessing a page with ~8  
photos on it. Notice the big fat (Rendering: 6.42337 (97%) ) at the  
bottom.

It can be seen that the https connection is continually opened and  
closed which is probably responsible for most of the slow down.

Are things normally like this?

Thanks

=================================  
SHOW FIELDS FROM `content_photos`  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
Rendered admin/content\_photos/\_content\_photo (0.46094)  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Opening new HTTPS connection to my\_app.s3.amazonaws.com:443  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Rendered admin/content\_photos/\_content\_photo (0.74744)  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Opening new HTTPS connection to my\_app.s3.amazonaws.com:443  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Rendered admin/content\_photos/\_content\_photo (0.66900)  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Opening new HTTPS connection to my\_app.s3.amazonaws.com:443  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
Rendered admin/content\_photos/\_content\_photo (0.67587)  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Opening new HTTPS connection to my\_app.s3.amazonaws.com:443  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Rendered admin/content\_photos/\_content\_photo (0.65983)  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Opening new HTTPS connection to my\_app.s3.amazonaws.com:443  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Rendered admin/content\_photos/\_content\_photo (0.62771)  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Opening new HTTPS connection to my\_app.s3.amazonaws.com:443  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
warning: peer certificate won’t be verified in this SSL session  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Rendered admin/content\_photos/\_content\_photo (0.84993)  
New RightAws::S3Interface using single-threaded mode  
Closing HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Opening new HTTPS connection to my\_app.s3.amazonaws.com:443  
Closing HTTPS connection to my\_app.s3.amazonaws.com:443  
Opening new HTTPS connection to [s3.amazonaws.com:443](http://s3.amazonaws.com:443)  
Rendered admin/content\_photos/\_content\_photo (0.63834)  
ContentFile Load (0.001071) SELECT \* FROM `content_files` WHERE  
(content\_files.content\_id = 1)  
ContentFile Columns (0.004495) SHOW FIELDS FROM `content_files`  
Rendered admin/content\_files/\_content\_file (0.00858)  
Rendered admin/content\_files/\_content\_file (0.00076)  
Page Load (0.001569) SELECT \* FROM `pages` WHERE (pages.deleted\_at  
IS NULL OR pages.deleted\_at \> ‘2008-04-12 23:08:47’) AND  
(pages.account\_id = 1 AND (name = ‘Main’)) LIMIT 1  
Completed in 6.56130 (0 reqs/sec) | Rendering: 6.42337 (97%) | DB:  
0.03947 (0%) | 200 OK [[http://localhost/admin/pages/1-Main/contents/1](http://localhost/admin/pages/1-Main/contents/1)]

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [April 13, 2008, 9:12am UTC](https://www.ruby-forum.com/t/is-amazon-s3-always-this-slow/134636/2 "2008-04-13T09:12:30Z")

</div>

I made some changes to prevent accessing all the files through an ssl  
connection, but it is still at about 3 seconds to download. (Actually  
the files are missing on the s3 server so it is really taking three  
seconds to find out that the files are not there).

The RightAws::S3Interface has also been changed from single-threaded  
mode to multi-threaded mode, but with very little, if any difference.

Can this be made any better?

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [April 28, 2009, 2:38am UTC](https://www.ruby-forum.com/t/is-amazon-s3-always-this-slow/134636/3 "2009-04-28T02:38:49Z")

</div>

Chris O. wrote:

> I made some changes to prevent accessing all the files through an ssl  
> connection, but it is still at about 3 seconds to download. (Actually  
> the files are missing on the s3 server so it is really taking three  
> seconds to find out that the files are not there).
> 
> The RightAws::S3Interface has also been changed from single-threaded  
> mode to multi-threaded mode, but with very little, if any difference.
> 
> Can this be made any better?

Hi Chris,

What were the changes you made to prevent the accessing of files via  
ssl?  
I’m experiencing the same slowness and am trying to figure out how to  
get a http connection to access the S3 files instead.

Thanks.
