A new way called DWS to run php script on nginx 0.8.x !
Igor Sysoev
igor at sysoev.ru
Sat Oct 9 15:26:50 MSD 2010
On Sat, Oct 09, 2010 at 04:47:36PM +0800, hightman wrote:
> PHP-DWS is the abbreviation for "PHP Direct Web Server". It works much like fastcgi server with nginx,
>
> But nginx pass the request header of HTTP and socket file description of this connection to it via
> calling sendmsg(), and then PHP-dws read request body data from http connection , send response
> data to the http connection directly.
>
> I simply draw their work in the following flow diagram:
>
> [PHP-CGI]
> ============
>
> i)request header+body ii)request header+body
> +~~~~>~~~~>~~~~>~~~+ +~~~~~>~~~~~>~~~~>~~~~~+
> | | | |
> /|\ \|/ / \ \|/
> WebVisitor Web Server FastCGIServer
> (user) (nginx) (php-cgi)
> /|\ \ / /|\ \ /
> | | | |
> +~~~<~~~~<~~~~<~~~~+ +~~~~~<~~~~~<~~~~<~~~~~+
> iv)response header+body iii)response header+body
>
> [PHP-DWS]
> ============
>
> i)request header ii)request header
> +~~~~>~~~~>~~~~>~~~+ +~~~~~>~~~~~>~~~~>~~~~~+
> | | | |
> /|\ \|/ / \ \|/
> WebVisitor Web Server DWSCGI Server
> (user) (nginx) (php-dws)
> /|\ \ / /|\ \ /
> | | | |
> | +~~~~~~~~>~~~~~~~~~~~~>~~~~~~~~~~~~>~~~~~~~~+ |
> | iii) request body |
> | |
> +~~~~~~~~~~~~~<~~~~~~~~~~~<~~~~~~~~~~~~~<~~~~~~~~~~~~~~+
> iv)response header+body
>
> I think that php-dws will save much more IO operator and become more efficient.
> In addition, we can send partial data to browser during script running, i.e:
> http://root.twomice.net/dws-test/sleep.phpd
>
> Welcome to give me some suggestions or comments!
What I never liked in unbufferd uploads, when people want to show
an upload progress bar, is that a large backend process is tied to
a client and the client may upload minutes. Now suppose that the backend
process size is 10M and there are 1000 uploading clients: you need 10G.
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list