A new way called DWS to run php script on nginx 0.8.x !

hightman hightman at zuaa.zju.edu.cn
Sun Oct 10 07:54:52 MSD 2010


After careful and extensive testing,  the performance of php-dws and php-cgi is almost the same, 
Only for large post requests, php-dws slightly better than php-cgi .


However,  The main features of php-dws is that response data returned directly to user browser.
In some special case, We may need to deal with long time requests or sub-output data according to demand
such as COMET application, Then you can consider using php-dws!

Thanks all.


在 2010-10-9,下午4:47, hightman 写道:

> 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! 
>   
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20101010/debf5612/attachment.html>


More information about the nginx mailing list