Current time: 04-20-2024, 07:32 PM Hello There, Guest! (LoginRegister)


Post Reply 
php-fpm support
Author Message
pulponair Offline
Junior Member
*

Posts: 10
Joined: Jun 2010
Reputation: 0
Post: #1
php-fpm support
Hi there,

as of version php 5.3.3 php ships with php-fpm.

One mayor benefit of using the fpm SAPI over regular fastcgi/fcgi starters is the fact, that i use a single root php process which enables us to share shm (shared memory - e.g. used by opcode caches) accross all runing php process.
This would dramatically increase opcode cache efficiency while it decreases overall memory consumption.

Another benefit is the fact that the php-fpm deamon is cabable of its own dynamic adaptive process spawning. So the php process handling can be handed over completly to php-fpm, instead of using a creppy mixture of fastcgi-pm and php's own child managment.

See http://php-fpm.org/ for the big picture.

I worked out a ispcp apache configuration (see below) and tested it in various scenarios (posted to php-highload as well).

Besides the apache configuration there has to be a php-fpm configuration which is pretty straight forward.

Note: You need mod_fastcgi, since mod_fcgi is'nt cabable of anything similar to FastCGIExternalServer

For a full ispcp integration the ispcp engine needs to be modified to manage the fpm configuration file.

Apache configuration is just a template matter.

If anyone could guide me (haven't worked with perl for decades Wink ). I could come up with a patch.

Within mod_fastcgi.conf (global):
Code:
# We want to have all sockets within this directory
FastCgiIpcDir /var/lib/apache2/fastcgi2

# Register a cumstom handler to .php .php5 scripts
AddHandler php-fastcgi .php .php5

# Point this handler to /php5/php-fpm
Action php-fastcgi /php5/php-fpm

# Set the register fastcgi-script handler +
# whatever you want for a fpm request.
<Location /php5/php-fpm>
       SetHandler fastcgi-script
       Options +ExecCGI
</Location>

#Set mime type
AddType application/x-httpd-php .php .php5

Per vhost:
Code:
# Alias /php5/ to /var/www/fcgi/www.example.com/  
ScriptAlias /php5/ /var/www/fcgi/www.example.com/

# Pickup request and forward it to the particular fpm socket.
FastCGIExternalServer /var/www/fcgi/www.example.com/php-fpm -socket
www.example.com

Cheers,
Nikolas
08-17-2010 10:45 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
php-fpm support - pulponair - 08-17-2010 10:45 PM
RE: php-fpm support - RatS - 08-19-2010, 05:08 AM
RE: php-fpm support - pulponair - 08-19-2010, 06:57 PM
RE: php-fpm support - gOOvER - 08-19-2010, 06:33 AM
RE: php-fpm support - Nuxwin - 08-19-2010, 11:02 PM
RE: php-fpm support - kilburn - 08-19-2010, 11:13 PM
RE: php-fpm support - pulponair - 08-19-2010, 11:22 PM
RE: php-fpm support - Nuxwin - 08-19-2010, 11:33 PM
RE: php-fpm support - pulponair - 08-19-2010, 11:48 PM
RE: php-fpm support - pulponair - 11-02-2011, 08:16 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)