# Mod\_rails: what MPM model should Apache use?

**URL:** <https://www.ruby-forum.com/t/mod-rails-what-mpm-model-should-apache-use/136920>\
**Category:** Rails\
**Created:** [May 7, 2008, 12:11pm UTC](https://www.ruby-forum.com/t/mod-rails-what-mpm-model-should-apache-use/136920 "2008-05-07T12:11:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuktuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Post date:** [May 7, 2008, 12:11pm UTC](https://www.ruby-forum.com/t/mod-rails-what-mpm-model-should-apache-use/136920/1 "2008-05-07T12:11:08Z")

</div>

When using mod\_php in Apache 2+ it is important to use the MPM-prefork  
version of Apache, because some PHP extensions are not thread-safe.

But what about mod\_rails? Can it use MPM-worker (multithreading), or  
does it also need MPM-prefork?

I’ve read other places, that Rails is not thread-safe. Does this afflict  
the choice?

- Carsten

---

<div class="post-metadata">

**Author:** ![tuktuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Post date:** [May 14, 2008, 11:35am UTC](https://www.ruby-forum.com/t/mod-rails-what-mpm-model-should-apache-use/136920/2 "2008-05-14T11:35:23Z")

</div>

On May 7, 12:11 pm, Carsten G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> When using mod\_php in Apache 2+ it is important to use the MPM-prefork  
> version of Apache, because some PHP extensions are not thread-safe.
> 
> But what aboutmod\_rails? Can it use MPM-worker (multithreading), or  
> does it also need MPM-prefork?
> 
> I’ve read other places, that Rails is not thread-safe. Does this afflict  
> the choice?

At the moment Phusion Passenger only supports the prefork MPM. Later  
versions will also support the worker MPM. Whether Ruby on Rails is  
thread-safe is totally irrelevant to Passenger.

---

<div class="post-metadata">

**Author:** ![tuktuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/77aa72/32.png) [@tuktuk](https://www.ruby-forum.com/u/tuktuk)\
**Post date:** [May 14, 2008, 12:22pm UTC](https://www.ruby-forum.com/t/mod-rails-what-mpm-model-should-apache-use/136920/3 "2008-05-14T12:22:45Z")

</div>

Hongli L. wrote:

> At the moment Phusion Passenger only supports the prefork MPM. Later  
> versions will also support the worker MPM. Whether Ruby on Rails is  
> thread-safe is totally irrelevant to Passenger.

Thanks!

- Carsten
