Everyone knows about apache
and most of us also have hands on experience with apache. Today let us see multi processing modules in it. Apcahe comes with 2 multi processing modules(MPMs):
1. Prefork
2. Worker
The defalut MPM is prefork.
What is the difference between this two?
Which one to use?
On high traffic websites worker is preferable because of low memory usage as comparison to prefork MPM but prefork is more safe if you are using libraries which are not thread safe.
For example, you cannot use mod_php with worker MPM as it is not thread safe.
So if you are using all thread safe libraries then go with worker and if you are not sure then use prefork MPM, you may have to increase your RAM in case of high traffic.
1. Prefork
2. Worker
The defalut MPM is prefork.
What is the difference between this two?
- Prefork MPM uses multiple child processes with one thread each and each process handles one connection at a time.
- Worker MPM uses multiple child processes with many threads each. Each thread handles one connection at a time.
Which one to use?
On high traffic websites worker is preferable because of low memory usage as comparison to prefork MPM but prefork is more safe if you are using libraries which are not thread safe.
For example, you cannot use mod_php with worker MPM as it is not thread safe.
So if you are using all thread safe libraries then go with worker and if you are not sure then use prefork MPM, you may have to increase your RAM in case of high traffic.
No comments:
Post a Comment