# Why everytime "IO#flush" take so long?

**URL:** <https://www.ruby-forum.com/t/why-everytime-io-flush-take-so-long/120257>\
**Category:** Rails\
**Created:** [November 15, 2007, 10:55am UTC](https://www.ruby-forum.com/t/why-everytime-io-flush-take-so-long/120257 "2007-11-15T10:55:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![betame342](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/90db22/32.png) [@betame342](https://www.ruby-forum.com/u/betame342)\
**Post date:** [November 15, 2007, 10:55am UTC](https://www.ruby-forum.com/t/why-everytime-io-flush-take-so-long/120257/1 "2007-11-15T10:55:02Z")

</div>

Hi,

I have question, on production site.(It is not happening on development  
site)  
The used memory resources at the production server stand at 50% to 60%

Every request to the main homepage take very long (6 -10 seconds for  
IO#flush. Do you guys know what is “IO#flush” doing? how to reduce the  
load time?

Rendering within layouts/site  
Rendering site/index  
Completed in 6.31200 (0 reqs/sec) | Rendering: 0.40600 (6%) | DB:  
5.43800 (86%) | 200 OK [[http://www.domain.com/](http://www.domain.com/)]  
[[http://www.domain.com/](http://www.domain.com/)]

Thread ID: 67783920  
Total: 6.313

%self total self wait child calls name  
81.69 5.16 5.16 0.00 0.00 4 IO#flush  
3.45 0.22 0.22 0.00 0.00 50  
ActiveRecord::Associations::AssociationCollection#reset  
1.25 0.14 0.08 0.00 0.06 8575 Mysql#get\_length

Thank you in advance
