# Logs - Rendering + DB don't add up to Completed?

**URL:** <https://www.ruby-forum.com/t/logs-rendering-db-dont-add-up-to-completed/133645>\
**Category:** Rails\
**Created:** [April 2, 2008, 8:16am UTC](https://www.ruby-forum.com/t/logs-rendering-db-dont-add-up-to-completed/133645 "2008-04-02T08:16:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jh100000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Post date:** [April 2, 2008, 8:16am UTC](https://www.ruby-forum.com/t/logs-rendering-db-dont-add-up-to-completed/133645/1 "2008-04-02T08:16:18Z")

</div>

Completed in 1.48324 (0 reqs/sec) | Rendering: 0.08862 (5%) | DB:  
0.00000 (0%)

In most production logs I have seen rendering plus db comes close to  
adding up to 100%; maybe 60% to 80%.

In this new app, I am getting the results above. The 0% DB I assume  
comes from a cached query.

What I don’t get is what is happening with the rest of the time?

1. In general, where is this time accounted for?

2. Any guess on what might be happening?

I went through the recent railscasts and ran rawk plus  
script/performance request (result attached). The biggest offenders in  
my app are IO#read (20%) and MySQL#get\_length (10%). This makes some  
sense because I am requesting a lot of records from the db but if so,  
why is DB time listed as 0%.

Any thoughts or pointers would be appreciated.

Thanks,

John

---

<div class="post-metadata">

**Author:** ![jh100000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b2d939/32.png) [@jh100000](https://www.ruby-forum.com/u/jh100000)\
**Post date:** [April 2, 2008, 8:57am UTC](https://www.ruby-forum.com/t/logs-rendering-db-dont-add-up-to-completed/133645/2 "2008-04-02T08:57:24Z")

</div>

The time is generally proportional.

It’s hard to do even vaguely accurate profiling on an object from  
within the object itself (which is what Rails is here trying to do).

It’s just a vague proportional indicator of how much time things will  
be taking (ie 50% database, 50% rendering for example).

Julian

Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO  
OUT 3rd APRIL  
[http://sensei.zenunit.com/](http://sensei.zenunit.com/)
