Bluehost.com Web Hosting $6.95

php accelerator that works in cgi mode?

This is a discussion on php accelerator that works in cgi mode? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I am looking for an open source php accelerator that works in cgi mode. I am guessing that to do ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-14-2003
Nick Bartos
 
Posts: n/a
Default php accelerator that works in cgi mode?

I am looking for an open source php accelerator that works in cgi mode. I
am guessing that to do that the cache would have to be on disk and not in
memory. I was looking at the turk accelerator (since it will cache to
disk), but it says somewhere that it will not work in cgi mode. I am
almost tempted to try it though.

Ideas? BTW my platform is linux.
Reply With Quote
  #2 (permalink)  
Old 08-14-2003
KAH
 
Posts: n/a
Default Re: php accelerator that works in cgi mode?

"Nick Bartos" <spam@2thebatcave.com> wrote in
news:pan.2003.08.14.13.04.41.996195@2thebatcave.co m:

> I am looking for an open source php accelerator that works in cgi
> mode. I am guessing that to do that the cache would have to be on
> disk and not in memory. I was looking at the turk accelerator (since
> it will cache to disk), but it says somewhere that it will not work in
> cgi mode. I am almost tempted to try it though.
>
> Ideas? BTW my platform is linux.


I doubt you'll find such a product. Why do you run in CGI mode anyway? It's
insecure, slow and has less functionality. Run it as an Apache module.

KAH
Reply With Quote
  #3 (permalink)  
Old 08-15-2003
Nick Bartos
 
Posts: n/a
Default Re: php accelerator that works in cgi mode?

actually the very reason I run it is for security.

I need to have php run as separate users for separate websites (so some
users can't screw with other users stuff). The only way I see to do this
is doing it through a cgi, or possibly doing an apache2 module using the
per-child mpm. However I don't want to go with apache2 and the per-child
mpm since it hasn't been tested that well.

And actually I don't run it as a cgi technically, I just use the cgi
executable. I have the .php, .php3, and .php4 extensions registered in
the linux kernel for a misc binary format, which allows all of the files
with that extension to be executed just like any other binary file (from
the web server or from the command line). This way the php binary is not
visable at all from the outside, so it is very secure in that reguard.
Also it gets around having to put the #! at the beginning of all the php
files.

If I could find a way to get apache suexec to work with php compiled as a
module in 1.3.x, I would be more than happy to switch. If there is some
way to do this please let me know. That would definately be a move in the
right direction for performance, but I can't sacrafice the security at
this point.



>
> I doubt you'll find such a product. Why do you run in CGI mode anyway? It's
> insecure, slow and has less functionality. Run it as an Apache module.
>
> KAH


Reply With Quote
  #4 (permalink)  
Old 08-16-2003
Nick Bartos
 
Posts: n/a
Default Re: php accelerator that works in cgi mode?

It looks like the solution is to use the apc cache with fastcgi (and a
slightly modified suexec).

After doing some crude bench testing, I came up with the cgi mode taking
1.6 times as long to process 400 requests (50 concurrently) on large (28K
lines) files. On small files (less than 10 lines), cgi mode took over 10
times longer. That of course is not good.

After implementing fastcgi and a modified suexec (to skip the owner/group
checks so I could get away with just one copy of the php binary), cgi mode
was fairly close to using mod_php statically in the httpd binary. The
average times for cgi were still a little slower, but the max times were
better than doing the module.

After implementing apc built statically into the php binary, the numbers
changed drastically. using that setup, cgi was now over 10x faster than
doing a module for the large files, and a bit better with smaller files
too.

As far as performance and security it looks like this will work well. Now
the test will be time in making sure that it ends up being stable...



On Thu, 14 Aug 2003 08:04:43 -0500, Nick Bartos wrote:

> I am looking for an open source php accelerator that works in cgi mode.
> I am guessing that to do that the cache would have to be on disk and not
> in memory. I was looking at the turk accelerator (since it will cache
> to disk), but it says somewhere that it will not work in cgi mode. I am
> almost tempted to try it though.
>
> Ideas? BTW my platform is linux.

Reply With Quote
  #5 (permalink)  
Old 08-20-2003
Manuel Lemos
 
Posts: n/a
Default Re: php accelerator that works in cgi mode?

Hello,

On 08/14/2003 10:04 AM, Nick Bartos wrote:
> I am looking for an open source php accelerator that works in cgi mode. I
> am guessing that to do that the cache would have to be on disk and not in
> memory. I was looking at the turk accelerator (since it will cache to
> disk), but it says somewhere that it will not work in cgi mode. I am
> almost tempted to try it though.
>
> Ideas? BTW my platform is linux.


AFAIK, you can tell Turck to stored compiled scripts in disk. When it
says it does not work in CGI mode, it means it will not cache the
compiled files in shared memory because those caches would be lost upon
script ending.

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:21 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0