<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span id="result_box" class="" lang="en"><span style="color: rgb(0, 0,
0);" title="">After careful and extensive testing, the performance of php-dws and php-cgi is almost the same, </span></span></div><div><span id="result_box" class="" lang="en"><span style="color: rgb(0, 0,
0);" title=""><span id="result_box" class="" lang="en"><span style="" title="">Only for large post requests, php-dws slightly better than php-cgi .</span></span></span></span></div><div><br></div><div><br></div><div><span id="result_box" class="" lang="en"><span style="color: rgb(0, 0,
0);" title=""><span id="result_box" class="" lang="en"><span style="" title="">However, The </span></span></span></span>main features of php-dws is that response data returned directly to user browser.</div><div>In some special case, We may need to deal with long time requests or sub-output data according to demand</div><div>such as COMET application, Then you can consider using php-dws!</div><div><br></div><div>Thanks all.</div><div><br></div><br><div><div>ÔÚ 2010-10-9£¬ÏÂÎç4:47£¬ hightman дµÀ£º</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">PHP-DWS is <span id="result_box" class="short_text" lang="en"><span style="color:
rgb(0, 0, 0);" title="">the abbreviation for "PHP Direct Web Server". It works much like fastcgi server with nginx, </span></span><div><span id="result_box" class="short_text" lang="en"><span style="color:
rgb(0, 0, 0);" title=""><br></span></span></div><div><span id="result_box" class="short_text" lang="en"><span style="color:
rgb(0, 0, 0);" title="">But nginx pass the request header of HTTP and socket file description of this connection to it</span></span> via </div><div>calling sendmsg(), and then PHP-dws read request body data from http connection , send response </div><div>data to the http connection directly.</div><div><br></div><div><span id="result_box" class="" lang="en"><span style="" title="">I
simply draw their work in the following flow diagram£º</span></span></div><div><span id="result_box" class="" lang="en"><span style="" title=""><br></span></span></div><div><span id="result_box" class="" lang="en"><span style="" title=""><code> [PHP-CGI]<br>
============<br>
<br> i)request header+body ii)request header+body<br>
+~~~~>~~~~>~~~~>~~~+
+~~~~~>~~~~~>~~~~>~~~~~+<br>
| | | |<br>
/|\ \|/ / \ \|/<br>
WebVisitor Web Server FastCGIServer<br>
(user) (nginx) (php-cgi)<br>
/|\ \ / /|\ \ /<br>
| | | |<br>
+~~~<~~~~<~~~~<~~~~+
+~~~~~<~~~~~<~~~~<~~~~~+<br>
iv)response header+body iii)response header+body</code></span></span></div><div><span id="result_box" class="" lang="en"><span style="" title=""><code><br></code></span></span></div><div><span id="result_box" class="" lang="en"><span style="" title=""><code> [PHP-DWS]<br> ============</code></span></span></div><div><br></div><div> <span class="Apple-style-span" style="font-family: monospace; ">i)request header ii)request header</span></div><code>
+~~~~>~~~~>~~~~>~~~+
+~~~~~>~~~~~>~~~~>~~~~~+<br>
| | | |<br>
/|\ \|/ / \ \|/<br>
WebVisitor Web Server DWSCGI Server<br>
(user) (nginx) (php-dws)<br>
/|\ \ / /|\ \ /<br>
| | | |<br>
| +~~~~~~~~>~~~~~~~~~~~~>~~~~~~~~~~~~>~~~~~~~~+ |<br>
| iii) request body |<br>
| |<br>
+~~~~~~~~~~~~~<~~~~~~~~~~~<~~~~~~~~~~~~~<~~~~~~~~~~~~~~+
<br>
iv)response header+body</code><div><font class="Apple-style-span" face="monospace"><br></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="font-family: 'Heiti SC'; ">I think that php-dws will save much more IO operator and become more e</span></font>fficient.</div><div><span id="result_box" class="short_text" lang="en"><span style="" title="">In addition, we can send partial data to browser during script running, i.e:</span></span></div><div><span id="result_box" class="short_text" lang="en"><span title=""><a href="http://root.twomice.net/dws-test/sleep.phpd">http://root.twomice.net/dws-test/sleep.phpd</a></span></span></div><div><br></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="font-family: 'Heiti SC'; "></span></font></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="font-family: 'Heiti SC'; ">Welcome to give me some suggestions or comments! </span></font></div><div><span class="Apple-style-span" style="font-family: monospace; "> </span></div><div><div><br></div></div></div>_______________________________________________<br>nginx mailing list<br><a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>http://nginx.org/mailman/listinfo/nginx<br></blockquote></div><br></body></html>