# Tailing the prod log: 2 req/sec

**URL:** <https://www.ruby-forum.com/t/tailing-the-prod-log-2-req-sec/86933>\
**Category:** Rails\
**Created:** [February 26, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/tailing-the-prod-log-2-req-sec/86933 "2007-02-26T23:06:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [February 26, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/tailing-the-prod-log-2-req-sec/86933/1 "2007-02-26T23:06:17Z")

</div>

can someone break down the req/sec part of the production log. I  
consistently see about 60% rendering, 20%db. First question, where is  
the  
other 20%? Second question, does this mean that database performance  
boosts  
wouldn’t help, how would I speed up ‘rendering’?

Thanks!

---

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [February 26, 2007, 11:37pm UTC](https://www.ruby-forum.com/t/tailing-the-prod-log-2-req-sec/86933/2 "2007-02-26T23:37:24Z")

</div>

The reason why it’s not 100% is something I also found strange.

In my experience, the database is mostly slower then the rendering (in  
my application that is).  
I got my rendertime down by caching what could be cached.  
I got a huge list which was rendered by partials and it took quite  
some time.  
After caching this page, it was almost instantaneous.

---

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [February 26, 2007, 11:52pm UTC](https://www.ruby-forum.com/t/tailing-the-prod-log-2-req-sec/86933/3 "2007-02-26T23:52:27Z")

</div>

Yeah - there is no caching now. Everything is dynamic down to the  
obligatory time\_ago\_in\_words…Theres a lot of avatars and stuff that  
might  
be able to be optimized.

---

<div class="post-metadata">

**Author:** ![blinking\_bear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a9a28c/32.png) [@blinking\_bear](https://www.ruby-forum.com/u/blinking_bear)\
**Post date:** [February 27, 2007, 12:50am UTC](https://www.ruby-forum.com/t/tailing-the-prod-log-2-req-sec/86933/4 "2007-02-27T00:50:33Z")

</div>

You can cache static pages by using caches\_page class method of Action  
Controller. It is also possible to cache only part of the page that is  
static while leaving the dynamic sections out by using fragment  
caching in Rails.

When you are under situations where you cannot cache due to security  
reasons you can use Action caching, this will be slower but that is  
the price to pay for enforcing security. Another cool way to speed up  
is to use memcached. You basically use a machine with lot of free  
memory as your cache server by installing memcached. The client must  
also be setup to connect to your server.

All these tricks are explained in Rails Cookbook.
