mod_php or fastcgi?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • howachen@gmail.com

    #1

    mod_php or fastcgi?

    hi,

    which package you perfer?

    mod_php on apache is okay but some people said fastcgi version of php
    is faster, is it true?

    thanks...

  • howachen@gmail.com

    #2
    Re: mod_php or fastcgi?


    Michael Vilain 寫道:
    In article <1152365690.253 421.109840@b28g 2000cwb.googleg roups.com>,
    howachen@gmail. com wrote:
    >
    hi,

    which package you perfer?

    mod_php on apache is okay but some people said fastcgi version of php
    is faster, is it true?

    thanks...
    >
    Depends. (That's the standard answer for ambiguous questions which don't
    have sufficient technical details to provide an informed opinion).
    >
    Specifically, it depends on the environment (hardware and software)
    you're running on. OS and version? Hardware platform--CPU, memory,
    disk? Shared web server or dedicated? What sort of web application are
    you running? How much traffic is it expected to handle currently? In 6
    months? 1 year? 3 years?
    >
    It's my understanding that fastcgi forks a process for each connection,
    running in the context of web server. mod_php runs as a thread, allowingfor
    it to run concurrently with other processes on multi-CPU systems.
    >
    --
    DeeDee, don't press that button! DeeDee! NO! Dee...
    consider the followings...

    OS - CentOS 4.3
    CPU - Intel Pentium D Dual Core 2.8Ghz
    Memory - 2GB DDR2
    Dedicated Web server
    Expect to handle around 500 connections, each requests use at most 3MB
    of memory

    Comment

    • Tim Roberts

      #3
      Re: mod_php or fastcgi?

      howachen@gmail. com wrote:
      >
      >which package you perfer?
      >
      >mod_php on apache is okay but some people said fastcgi version of php
      >is faster, is it true?
      It doesn't matter. The difference in speed between the two approaches is
      dwarfed by the improvements you can get in caching and improving your
      algorithms. Further, unless you intend for your web site to serve hundreds
      of hits per second, the difference won't be noticeable.

      Don't start micro-optimizing until you know that the simplest approach
      doesn't meet the specs.
      --
      - Tim Roberts, timr@probo.com
      Providenza & Boekelheide, Inc.

      Comment

      • Chung Leong

        #4
        Re: mod_php or fastcgi?

        Michael Vilain wrote:
        It's my understanding that fastcgi forks a process for each connection,
        running in the context of web server. mod_php runs as a thread, allowing for
        it to run concurrently with other processes on multi-CPU systems.
        Not quite. If it creates a process per connection then it wouldn't be
        fast. FastCGI works sort of like a Java app server. It runs it a
        separate process and communicates with the web server across a socket
        connection. Since interprocess communication is very fast, FastCGI is
        at least on-par with an in-process module in terms of performace. And
        the decoupling of web-server from the app-server allows resources to be
        better managed, so it could be actually be faster. For example,
        persistent connections when used with mod_php is quite wasteful, since
        every Apache process would own a connection to the database, even
        though it might actually spend majority of the time serving image files.

        Comment

        • howachen@gmail.com

          #5
          Re: mod_php or fastcgi?


          Tim Roberts 寫道:
          howachen@gmail. com wrote:

          which package you perfer?

          mod_php on apache is okay but some people said fastcgi version of php
          is faster, is it true?
          >
          It doesn't matter. The difference in speed between the two approaches is
          dwarfed by the improvements you can get in caching and improving your
          algorithms. Further, unless you intend for your web site to serve hundreds
          of hits per second, the difference won't be noticeable.
          >
          Don't start micro-optimizing until you know that the simplest approach
          doesn't meet the specs.
          in fact, security is also one of the concern. people said fastcgi
          version is more secure, and reliable

          Comment

          • Richard Levasseur

            #6
            Re: mod_php or fastcgi?


            Michael Vilain wrote:
            In article <1152384534.171 573.170610@m73g 2000cwd.googleg roups.com>,
            howachen@gmail. com wrote:
            >
            Michael Vilain õçì¼ÅF
            In article <1152365690.253 421.109840@b28g 2000cwb.googleg roups.com>,
            howachen@gmail. com wrote:
            >
            hi,

            which package you perfer?

            mod_php on apache is okay but some people said fastcgi version of php
            is faster, is it true?

            thanks...
            >
            Depends. (That's the standard answer for ambiguous questions which don't
            have sufficient technical details to provide an informed opinion).
            >
            Specifically, it depends on the environment (hardware and software)
            you're running on. OS and version? Hardware platform--CPU, memory,
            disk? Shared web server or dedicated? What sort of web application are
            you running? How much traffic is it expected to handle currently? In 6
            months? 1 year? 3 years?
            >
            It's my understanding that fastcgi forks a process for each connection,
            running in the context of web server. mod_php runs as a thread, allowing
            for
            it to run concurrently with other processes on multi-CPU systems.
            >
            --
            DeeDee, don't press that button! DeeDee! NO! Dee...
            consider the followings...

            OS - CentOS 4.3
            CPU - Intel Pentium D Dual Core 2.8Ghz
            Memory - 2GB DDR2
            Dedicated Web server
            Expect to handle around 500 connections, each requests use at most 3MB
            of memory
            >
            For security on my shared web host, I use CGI when I need to run a perl
            script as a specific user. My ISP provides CGIwrap for this purpose.
            Otherwise, I run all my site using mod_php. It can access the MySQL
            database and display the pages and is fast enough.
            >
            Since you have a dual core system, I'd use mod_php. You'd be able to benefit
            from it immediately with a threaded Apache server. And the site will
            scale if you add more CPUs.
            >
            --
            DeeDee, don't press that button! DeeDee! NO! Dee...
            Theorectically, except PHP isn't thread safe, and requires you use the
            pre-fork model of apache. This is suppose to change, eventually. Word
            is mod_php is faster, by and large though, probably because its
            integrated more with apache than a completely seperate cgi process.

            Comment

            Working...