# Rails runtime

**URL:** <https://www.ruby-forum.com/t/rails-runtime/158842>\
**Category:** Rails\
**Created:** [January 28, 2009, 5:36pm UTC](https://www.ruby-forum.com/t/rails-runtime/158842 "2009-01-28T17:36:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![camilleroux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@camilleroux](https://www.ruby-forum.com/u/camilleroux)\
**Post date:** [January 28, 2009, 5:36pm UTC](https://www.ruby-forum.com/t/rails-runtime/158842/1 "2009-01-28T17:36:48Z")

</div>

Hi,

I’ve a question about the Rails runtime.  
I’d like to know which part of Rails is executed (and put in memory) at  
each request? at each server launch?  
In other words, is Rails like PHP (the whole code is “executed” at each  
request)?

Thanx  
Camille R.

---

<div class="post-metadata">

**Author:** ![camilleroux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@camilleroux](https://www.ruby-forum.com/u/camilleroux)\
**Post date:** [January 28, 2009, 6:10pm UTC](https://www.ruby-forum.com/t/rails-runtime/158842/2 "2009-01-28T18:10:21Z")

</div>

On 28 Jan 2009, at 16:36, Camille R. wrote:

> Hi,
> 
> I’ve a question about the Rails runtime.  
> I’d like to know which part of Rails is executed (and put in memory)  
> at  
> each request? at each server launch?  
> In other words, is Rails like PHP (the whole code is “executed” at  
> each  
> request)?

All of your app code (and the framework) is loaded when the mongrel,  
passenger instance etc. is launched (passenger can do clever things  
with fork if you’re using REE).

Fred

---

<div class="post-metadata">

**Author:** ![camilleroux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4491bb/32.png) [@camilleroux](https://www.ruby-forum.com/u/camilleroux)\
**Post date:** [January 29, 2009, 4:51am UTC](https://www.ruby-forum.com/t/rails-runtime/158842/3 "2009-01-29T04:51:38Z")

</div>

Camille R. wrote:

> I’ve a question about the Rails runtime.  
> I’d like to know which part of Rails is executed (and put in memory) at  
> each request? at each server launch?  
> In other words, is Rails like PHP (the whole code is “executed” at each  
> request)?

On on start-up in production mode a Rails app will load, execute,  
and cache the Rails framework plus certain parts of the app code.  
The rest of the app code is loaded and cached on-demand when an  
unknown class or module is referenced during a request.

–  
Rails Wheels - Find Plugins, List & Sell Plugins -  
[http://railswheels.com](http://railswheels.com)
