Reputation: 12689
I notice css/js download of my site homepage on Heroku, takes a second and half more or less. I'm curious if some of you guys, has same experience or should I expect faster responce.
http://gitwatcher.com/assets/application-61efaf20532302f93b6c79d976861884.css:
GET application-61efaf...6c79d976861884.css 200 OK gitwatcher.com 19.4 KB 75.101.163.44:80
476ms
http://gitwatcher.com/assets/application-66c036d6d06705744603507b085afdf4.js:
GET application-66c036...603507b085afdf4.js 200 OK gitwatcher.com 62.7 KB 75.101.163.44:80
1.24s
also DNS responce seems quite low, about 1.08s.
Could you please share your experience or suggestions ?
Upvotes: 1
Views: 417
Reputation: 12689
I followed "Using a CDN Asset Host with Rails 3.1" as suggested but things are going even worst now:
CSS are served ~3.5 times slower then before :
GET https://gitwatcher-assets.s3.amazonaws.com/assets/application-82e153501de8c4032d1565a3e8adffc1.css
200 OK
,
gitwatcher-assets.s3.amazonaws.com
166.2 KB
178.236.4.193:443
1.62s
while js takes 1.7s vs 1.25 :
https://gitwatcher-assets.s3.amazonaws.com/assets/application-66c036d6d06705744603507b085afdf4.js
200 OK
gitwatcher-assets.s3.amazonaws.com
198.6 KB
178.236.4.193:443
1.7s
even worse, all png images are now downloaded from S3 with a media of 1.5s each one ( more or less in parallel of course ), resoulting in a ~4s overall time for the home page (bad), which is more or less as before, but now DNS overhead is light ( ~ 1/3 ). Than I guess static asset served via S3 is slower than directly served by heroku .... !?!
I'll leave it like that until I'll have some more analytics, but I wonder if some one can share his experience and performance data about serving static assets this way, to compare with.
ALL measures here are taken via FireBug client side (firefox: 93.34.152.23) and the bucket is in Ireland.
Upvotes: 0
Reputation: 37507
Use the asset_sync gem to have your assets pushed to S3 on deployment. Ideally you don't want your processes at Heroku serving assets, leave them to process Ruby - have all your static assets on S3 and/or Cloudfront or similar.
Upvotes: 3