# Hardware/Ram Requirements

**URL:** <https://www.ruby-forum.com/t/hardware-ram-requirements/104178>\
**Category:** Rails\
**Created:** [May 15, 2007, 2:23am UTC](https://www.ruby-forum.com/t/hardware-ram-requirements/104178 "2007-05-15T02:23:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [May 15, 2007, 2:23am UTC](https://www.ruby-forum.com/t/hardware-ram-requirements/104178/1 "2007-05-15T02:23:39Z")

</div>

I have a web-app created for reporting purpose with over 150,000 rows  
in the DB that has anywhere between 3-8 clauses being run on it  
everytime someone creats a report.

Reports return back anywere from a couple hundred rows to over 100,000  
if I am exporting it to excel.

Their is between 200-500 reports being created a day.

I was wondering how much ram and what hardware requirements do you  
think such a system would require? Correct me if I am wrong but the  
slowless I think is due to the amount of ram allocated to mySQL.

Apache needs to be restarted every couple of days.

Thanks for your input.

Your Friend,

John

–  
John K.  
removed\_email\_address@domain.invalid

[http://www.kopanas.com](http://www.kopanas.com)

> **[Canadian University Software Engineering Conference - CUSEC](http://cusec.net/)**
>
> Canadian University Software Engineering Conference is a yearly conference created by students for students.

[http://www.soen.info](http://www.soen.info)

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [May 15, 2007, 2:32am UTC](https://www.ruby-forum.com/t/hardware-ram-requirements/104178/2 "2007-05-15T02:32:39Z")

</div>

> Reports return back anywere from a couple hundred rows to over 100,000  
> if I am exporting it to excel.

You need to paginate and write this in chunks. Fetching 100K rows is  
going to take enormous amounts of RAM. Then instantiating them as  
objects is going to take another elephant. The simple way to do this  
is just to use offset and limit. Fetch 1k objects at a time, process,  
write to disk, grab the next 1k and so forth.

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [May 15, 2007, 6:40pm UTC](https://www.ruby-forum.com/t/hardware-ram-requirements/104178/3 "2007-05-15T18:40:05Z")

</div>

On 5/15/07, DHH [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The simple way to do this is just to use offset and limit.  
> Fetch 1k objects at a time, process, write to disk, grab the next 1k  
> and  
> so forth.  
> …

as documented by Jamis B. in:

[Buckblog: Faking cursors in ActiveRecord](http://weblog.jamisbuck.org/2007/4/6/faking-cursors-in-activerecord)

## Alain R.

[http://blog.ravet.com](http://blog.ravet.com)
