How to choosing PHP module for Apache ?

While googling, I found some interesting data Benchmark Comparison on Serving Simple PHP: LiteSpeed vs Apache vs Nginx so I choose only mod_php, mod_fastcgi, mod_fcgid and suPHP to compare and analysis in this article.

The difference between each Apache PHP modules are

  • mod_php is module that run with single user. It is the fastest module as you can see above benchmark. But it is less security because its method that use single user to run all php script.
  • suPHP is module that run with each user. suPHP will create each processes to handle each users. So if some users has been hacked. It will not affect to the others users. But this method is come with less then 50 times performance compare to mod_php
  • mod_fastcgi and mod_fcgid are the same as suPHP except it will reserve memory and process for each users. So it will more faster than suPHP but require much more resources than suPHP
  • mod_fastcgi and mod_fcgid concept are the same but difference in term of implement as you can see performance that nearly the same.

So what should we choose?

Use mod_php if

  • You have only one website on the server or you are the only one that take care this server
  • Heavy load website and want performance

Use suPHP if

  • You have server that is hosting provider or having many website access to the same server.
  • Small load on each website and you have small resource of your server

Use mod_fastcgi or mod_fcgid if

  • You have server that is hosting provider or having many website access to the same server.
  • Heavy load website and you have the great server

If you have any others ideas, please tell me what you think.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s