My MPM-Worker Calculator

Avatar forum:wipeout 7 years, 2 months ago

Hi all,

Here is a calculator I made to determine the effects of changing the different settings form MPM-Worker based on what is written on apache.org and my own testing..

Feel free to make any comments but it has worked for me..

.ods version

https://www.sugarsync.com/pf/D6185870989003861604

.xls version

https://www.sugarsync.com/pf/D6185870989003861602

21 Replies

@hybinet:

Isn't that PPA outdated? It's stuck at 5.3.5, whereas PHP is at 5.3.8 now. A few security issues have been fixed in the meantime.

It was up-to-date the last time I poked at this project. :-) It has been on the back burner for some whiles. Unfortunately, I don't think I'm going to be able to dawdle until the next Ubuntu LTS, so it shall be revisited again.

I've got the PHP end of it settled away (using ppa:nginx/php5 for now), but somehow, I thought that modfcgid and/or modfastcgi were not readily available with a stock Apache.

So there's this command, 'apt-cache search'. Pretty cool.

rtucker@witte:~$ apt-cache search --names-only apache.+f\(ast\)?cgi
libapache2-mod-fastcgi - Apache 2 FastCGI module for long-running CGI scripts
libapache2-mod-fcgid - an alternative module compat with mod_fastcgi
libapache2-mod-fcgid-dbg - debugging symbols for mod_fcgid

So I wonder what my problem was… I suspect it was a documentation-comprehension issue. Probably time to pick it up again and try some more. :-)

So PHP-FPM is easy enough, but how does one get modfastcgi and/or modfcgid and/or whatever going with Apache? I'm looking to do this (believe it or not) but I haven't found a good solid howto for Ubuntu 10.04. My constraints:

1) No compiling

2) Minimal PPA usage

3) FastCGI discourse must occur over TCP (the web server shall not expect to launch the application, nor shall it expect it to be on the same machine)

I haven't looked around for awhile and it's somewhat on the back burner, but this kinda jogged my memory so I thought I'd ask.

@MaxVicari:

but that may have to change if I deploy blog/forums software, as it seems everything is written in PHP these days…

I'd just up and say "that's because PHP is the only language where correctly implementing a blog isn't trivial", but my blog is a PHP-based one. Turns out I use it because I like the theme and can't be arsed to use something different. (Same with Gallery2, oh how you vex me.)

I will go ahead and link to some Django-based blog projects, though. Forums may require a little more kicking, but not that much.

(Private to bjl: If I ever get around to building a Django-based photo gallery, it will support other storages e.g. S3, and it will have a way to migrate Gallery2 stuff to it. I'll let you know.)

Have people seen a significant difference with MPM worker on Linode? Since one advantage is purportedly memory usage, I'd think the worker MPM would be popular on Linode.

Since I don't have any PHP requirements, I'm currently running MPM worked, but that may have to change if I deploy blog/forums software, as it seems everything is written in PHP these days…

@MaxVicari:

Since I don't have any PHP requirements, I'm currently running MPM worked, but that may have to change if I deploy blog/forums software, as it seems everything is written in PHP these days…

You only have an issue using MPM-Worker if you want to use mod_php because apparently its not thread safe..

You can stay with MPM-Worker and run php-cgi or fcgid.. I have used both..

Isn't MPM event supposed to be better/newer/uberer than MPM worker?

@swaj:

Isn't MPM event supposed to be better/newer/uberer than MPM worker?

As I understand it MPM-event is the evolution of MPM-worker but its not production ready..

@MaxVicari:

…it seems everything is written in PHP these days.

What a disgusting thought.

James

I appreciate bashing PHP as much as the next guy, but I was also looking for advice on MPM worker :)

Also, in another thread somebody said to "use modfastcgi, not modfcgid" for PHP, which confused me because I thought it was the other way around.

@MaxVicari:

Also, in another thread somebody said to "use modfastcgi, not modfcgid" for PHP, which confused me because I thought it was the other way around.

I was also under the impression it was the other way around.. :)

For most of my sites I use php-cgi.. I only use fcgid on the busier sites or more complicated sites where I want a little faster response time..

As I understand it the "new" best solution will be php-FPM.. I have not played with it yet..

PHP sucks, yadda yadda yadda (bandwagon bandwagon bandwagon)… but if you must use it you should be using php-fpm. Forget mod_php, php-cgi, or any other crap.

@swaj:

PHP sucks, yadda yadda yadda (bandwagon bandwagon bandwagon)…
Not as much as Java does.
@swaj:

but if you must use it you should be using php-fpm.
So you say I should use Debian testing or thirdparty repositories? Doesn't make any sense for me.
@swaj:

Forget mod_php, php-cgi, or any other crap.
I don't think you understand the difference between CGI and FastCGI…

And I can serve a crazy lot of parallel requests with mod_fastcgi.

Also, this is why you shouldn't use mod_fcgid with php-fastcgi.

@rsk:

@swaj:

but if you must use it you should be using php-fpm.
So you say I should use Debian testing or thirdparty repositories? Doesn't make any sense for me.

Maybe I'm missing something, but php-fpm should be available in debian stable, since that's got PHP 5.3.3, which was the version of PHP in which php-fpm was merged into PHP as core functionality. Unless debian disables fpm in their package builds?

@Guspaz:

Maybe I'm missing something, but php-fpm should be available in debian stable, since that's got PHP 5.3.3, which was the version of PHP in which php-fpm was merged into PHP as core functionality. Unless debian disables fpm in their package builds?

I'd be interested in a Linode library guide that sets up Debian with this new "FPM" thing, as PHP has always confused me :)

http://library.linode.com/search?query=%22php-fpm%22

@hoopycat:

1) No compiling

2) Minimal PPA usage

3) FastCGI discourse must occur over TCP (the web server shall not expect to launch the application, nor shall it expect it to be on the same machine)
1) This can be solved by using a good PPA (for Ubuntu) or Dotdeb (for Debian). The latter is very reliable, whereas it's more difficult to find good PHP PPAs for Ubuntu. There are several of them, but as far as I can tell, none are updated properly.

2) You can't really avoid this if you want to stick to Ubuntu 10.04. More recent versions of Ubuntu have official php5-fpm packages.

3) IIRC, modfastcgi can do this, but modfcgid can't.

Another way to run PHP without all the FastCGI baggage is to run two instances of Apache, one with worker, and the other with mod_php. Make the first instance listen to the public port, and proxy all PHP requests to the second instance. This is more or less the same as setting up nginx in front of Apache, except you now have two Apaches eating up more of your precious RAM.

@hoopycat:

I've got the PHP end of it settled away (using ppa:nginx/php5 for now)
Isn't that PPA outdated? It's stuck at 5.3.5, whereas PHP is at 5.3.8 now. A few security issues have been fixed in the meantime.

Both modfastcgi and modfcgid have been available in the official repositories for a few years.

If you don't care about FPM you can use php's old fastcgi handler by using the -b switch, works great for me and can be used on the versions from the standard repos.

I wonder why no one mentioned spawn-fcgi. It works just fine.

@Azathoth:

I wonder why no one mentioned spawn-fcgi. It works just fine.
Yep, spawn-fcgi works just fine, too. It lacks some of the advanced features of FPM, such as dynamic process management and graceful restart, but that's OK for most small-to-medium sites. It's just a little out of fashion now that nginx has eclipsed lighttpd as the VPS industry's lightweight server of choice.

@Guspaz:

Maybe I'm missing something, but php-fpm should be available in debian stable, since that's got PHP 5.3.3, which was the version of PHP in which php-fpm was merged into PHP as core functionality. Unless debian disables fpm in their package builds?
From my understanding, 5.3.3 happened soon enough before the freeze they didn't want to risk enabling FPM and confusing everyone and everything. It'll be in next stable, but not here in 6.0.

And, btw… does any of you actually know if FPM does somehow avoid the issue of mod_fcgid being dumb (see the explaination I've linked above)?

Or is it once again something that helps only users of nginx?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct