PHP-FASTCGI Configuration and testing (under Linux)

Source: Internet
Author: User

First, configure php-fastcgi

1, installation wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
Tar xzf mod_fastcgi-2.4.6.tar.gz
CD mod_fastcgi-2.4.6
CP MAKEFILE.AP2 Makefile
Make Top_dir=/usr/local/apache
Make Top_dir=/usr/local/apache Install


2, edit httpd.conf configuration file, add the fastcgi module load code:
LoadModule Fastcgi_module modules/mod_fastcgi.so


3, configure Apache support PHP
Edit the httpd.conf file and add the following code:
### fastcgi ###
scriptalias/fcgi-bin/"/usr/local/php/bin/"
AddHandler php-fastcgi. php
Action php-fastcgi/fcgi-bin/php-cgi
AddType application/x-httpd-php. php

<ifmodule mod_fcgid.c>
AddHandler Fcgid-script. . php. fcgi ### temporarily configures support only. php
IdleTimeout 300
Processlifetime 1800
Maxprocesscount 100
Defaultminclassprocesscount 3
Defaultmaxclassprocesscount 8
Ipcconnecttimeout 15
Ipccommtimeout 300
Maxrequestsperprocess 100
</IfModule>
### fastcgi ###


4, edit httpd.conf file, set up a virtual host can be configured like this:
<virtualhost *:80>
Documentroot/usr/local/apache/htdocs
ServerName localhost
Options +execcgi
AddHandler Fastcgi-script. fcgi
AddType application/x-httpd-php. php
Action application/x-httpd-php/fcgi-bin/php-cgi
<Directory/usr/local/apache/htdocs>
Options Indexes execcgi
Order Allow,deny
Allow from all
</Directory>

</VirtualHost>


Second, the pressure test

A total of 500 persons requested 5,000 orders as follows:

/usr/local/apache/bin/ab-c 500-n 5000 http://localhost/index.php

The following is a test result configured with php-fastcgi:



The following test results are not configured for php-fastcgi:



Third, summary

The performance of php-fastcgi is quite remarkable.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.