php accelerator that works in cgi mode?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick Bartos

    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.
  • KAH

    #2
    Re: php accelerator that works in cgi mode?

    "Nick Bartos" <spam@2thebatca ve.com> wrote in
    news:pan.2003.0 8.14.13.04.41.9 96195@2thebatca ve.com:
    [color=blue]
    > 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.[/color]

    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

    Comment

    • Nick Bartos

      #3
      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.


      [color=blue]
      >
      > 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[/color]

      Comment

      • Vid Strpic

        #4
        Re: php accelerator that works in cgi mode?

        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        Nick Bartos whispered unto us in comp.lang.php:[color=blue]
        > 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.[/color]

        Run it as apache 1.3 module, in secure mode? Works well for me, at
        least.


        - Vid `RTFM` Strpic.
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.2.2 (GNU/Linux)

        iD8DBQE/PNPMq1AzG0/iPGMRAihmAKCpkE ERaC5xjUug4LCZ/4CjMbGDjwCeMD6n
        KEFX01hZIlA1478 eUMBqjA8=
        =5cCQ
        -----END PGP SIGNATURE-----

        --
        vms@bofhlet.net, IRC:*@Martin, /bin/zsh. C|N>K
        Linux moria 2.4.21 #1 Sat Jul 5 16:11:20 CEST 2003 i686
        14:35:32 up 25 days, 23:20, 8 users, load average: 0.20, 0.12, 0.12

        Comment

        • Nick Bartos

          #5
          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:
          [color=blue]
          > 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.[/color]

          Comment

          • Manuel Lemos

            #6
            Re: php accelerator that works in cgi mode?

            Hello,

            On 08/14/2003 10:04 AM, Nick Bartos wrote:[color=blue]
            > 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.[/color]

            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


            Comment

            Working...