# Strange performance issue

**URL:** <https://www.ruby-forum.com/t/strange-performance-issue/140851>\
**Category:** Rails\
**Created:** [June 19, 2008, 6:43am UTC](https://www.ruby-forum.com/t/strange-performance-issue/140851 "2008-06-19T06:43:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [June 19, 2008, 6:43am UTC](https://www.ruby-forum.com/t/strange-performance-issue/140851/1 "2008-06-19T06:43:18Z")

</div>

I have a strange performance issue and have no idea how to find the  
bottle neck. A page on my site ([Premium Domain Broker - DNX.com](http://www.neco.com/events/2783239)) is  
taking way too long to load. So I decided to test it out via curl to see  
how fast it was downloading the page and this is what I got:

ben-johnsons-macbook-pro-17:neco-website benjohnson$ time curl -o  
output.txt [Premium Domain Broker - DNX.com](http://www.neco.com/events/2783239)  
% Total % Received % Xferd Average Speed Time Time Time  
Current  
Dload Upload Total Spent Left  
Speed  
100 955k 100 955k 0 0 198k 0 0:00:04 0:00:04 --:–:–  
251k

real 0m4.954s  
user 0m0.018s  
sys 0m0.077s

5 seconds for a page that size is not too bad. But in the browser is  
takes around 15 seconds to load. Are there any tools I can use to  
determine was part of my layout is taking a while to load? Because the  
browser seems to work VERY hard to display that page. Why is the browser  
working so hard? Our competitors sites (ex:  
[http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/](http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/))  
have pages with more tickets that load faster and their pages are  
actually bigger in size. I’m just really frustrated and confused.

Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [June 19, 2008, 6:46am UTC](https://www.ruby-forum.com/t/strange-performance-issue/140851/2 "2008-06-19T06:46:05Z")

</div>

Also, you can see a significant speed decrease for our competition:

ben-johnsons-macbook-pro-17:neco-website benjohnson$ time curl -o  
poo.txt  
[http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/](http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/)  
% Total % Received % Xferd Average Speed Time Time Time  
Current  
Dload Upload Total Spent Left  
Speed  
100 613k 0 613k 0 0 52750 0 --:–:-- 0:00:11 --:–:–  
53612

real 0m11.920s  
user 0m0.016s  
sys 0m0.054s

Yet, their page loads much faster in the browser, and takes twice as  
long to download. Really weird. Here are the 2 URLS, try for yourself:

> **[Premium Domain Broker - DNX.com](https://dnx.com/sign-up)**
>
> Domain name brokerage services

[http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/](http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/)

---

<div class="post-metadata">

**Author:** ![benjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Post date:** [June 19, 2008, 7:44am UTC](https://www.ruby-forum.com/t/strange-performance-issue/140851/3 "2008-06-19T07:44:29Z")

</div>

On Wed, Jun 18, 2008 at 9:46 PM, Ben J.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Yet, their page loads much faster in the browser, and takes twice as  
> long to download. Really weird. Here are the 2 URLS, try for yourself:
> 
> [Premium Domain Broker - DNX.com](http://www.neco.com/events/2783239)
> 
> [http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/](http://www.stubhub.com/dallas-cowboys-tickets/cowboys-vs-vikings-8-28-2008-615078/)

Ben,

Your main page itself is loading in less than a second. It’s all the  
other stuff on the page that’s causing problems.

Use Firebug’s net tab to see all the stuff your page is loading. Use  
YSlow to get some pointers on how you aren’t exploiting HTTP well.  
Both are Firefox plugins you’ll soon find indispensable 🙂

1. You aren’t bundling your assets. For example: \<%=  
stylesheet\_link\_tag :all, :cache =\> “cache/all” %\> to generate a  
single public/stylesheets/cache/all.css
2. You aren’t setting an Expires header on your assets. Every page  
request has to hit the server for every image, javascript, and css  
file. Setup an Expires header long in the future so they’re never  
re-requested until the file itself changes.
3. The only thing in your app that’s too slow is seats.xml. Speed up  
that action or cache it.

But most of all, get friendly with Firebug and YSlow!

Good luck,  
jeremy
