Mercurial > hg > nginx-site
changeset 1797:be868c8f6e9c
Added article about processing TCP/UDP sessions.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Wed, 21 Sep 2016 15:35:35 +0300 |
parents | 1d576e8d6ead |
children | 59d1f512c3a0 |
files | xml/en/GNUmakefile xml/en/docs/index.xml xml/en/docs/stream/stream_processing.xml xml/ru/GNUmakefile xml/ru/docs/index.xml xml/ru/docs/stream/stream_processing.xml |
diffstat | 6 files changed, 201 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/GNUmakefile +++ b/xml/en/GNUmakefile @@ -108,6 +108,7 @@ REFS = \ stream/ngx_stream_split_clients_module \ stream/ngx_stream_ssl_module \ stream/ngx_stream_upstream_module \ + stream/stream_processing \ TOP = \ download \
--- a/xml/en/docs/index.xml +++ b/xml/en/docs/index.xml @@ -8,7 +8,7 @@ <article name="nginx documentation" link="/en/docs/" lang="en" - rev="32" + rev="33" toc="no"> @@ -86,6 +86,14 @@ <list type="bullet"> <listitem> +<link doc="stream/stream_processing.xml"/> +</listitem> + +</list> + +<list type="bullet"> + +<listitem> <link url="http://www.aosabook.org/en/nginx.html">Chapter “nginx” in “The Architecture of Open Source Applications”</link> </listitem>
new file mode 100644 --- /dev/null +++ b/xml/en/docs/stream/stream_processing.xml @@ -0,0 +1,90 @@ +<!-- + Copyright (C) Nginx, Inc. + --> + +<!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> + +<article name="How nginx processes a TCP/UDP session" + link="/en/docs/stream/stream_processing.html" + lang="en" + rev="1"> + +<section> + +<para> +A TCP/UDP session from a client is processed +in successive steps called <b>phases</b>: + +<list type="tag"> + +<tag-name id="postaccept_phase"> +<literal>Post-accept</literal> +</tag-name> +<tag-desc> +The first phase after accepting a client connection. +The <link doc="ngx_stream_realip_module.xml">ngx_stream_realip_module</link> +module is invoked at this phase. +</tag-desc> + +<tag-name id="preaccess_phase"> +<literal>Pre-access</literal> +</tag-name> +<tag-desc> +Preliminary check for access. +The <link doc="ngx_stream_limit_conn_module.xml">ngx_stream_limit_conn_module</link> +module is invoked at this phase. +</tag-desc> + +<tag-name id="access_phase"> +<literal>Access</literal> +</tag-name> +<tag-desc> +Client access limitation before actual data processing. +The <link doc="ngx_stream_access_module.xml">ngx_stream_access_module</link> +module is invoked at this phase. +</tag-desc> + +<tag-name id="ssl_phase"> +<literal>SSL</literal> +</tag-name> +<tag-desc> +TLS/SSL termination. +The <link doc="ngx_stream_ssl_module.xml">ngx_stream_ssl_module</link> +module is invoked at this phase. +</tag-desc> + +<tag-name id="preread_phase"> +<literal>Preread</literal> +</tag-name> +<tag-desc> +Reading initial bytes of data into the preread buffer +to allow analyzing the data before its processing. +</tag-desc> + +<tag-name id="content_phase"> +<literal>Content</literal> +</tag-name> +<tag-desc> +Mandatory phase where data is actually processed, usually +<link doc="ngx_stream_proxy_module.xml">proxied</link> to +<link doc="ngx_stream_upstream_module.xml">upstream</link> servers, +or a specified value +is <link doc="ngx_stream_return_module.xml">returned</link> to a client. +</tag-desc> + +<tag-name id="log_phase"> +<literal>Log</literal> +</tag-name> +<tag-desc> +The final phase +where the result of a client session processing is recorded. +The <link doc="ngx_stream_log_module.xml">ngx_stream_log_module</link> +module is invoked at this phase. +</tag-desc> +</list> + +</para> + +</section> + +</article>
--- a/xml/ru/GNUmakefile +++ b/xml/ru/GNUmakefile @@ -96,6 +96,7 @@ REFS = \ stream/ngx_stream_split_clients_module \ stream/ngx_stream_ssl_module \ stream/ngx_stream_upstream_module \ + stream/stream_processing \ TOP = \ download \
--- a/xml/ru/docs/index.xml +++ b/xml/ru/docs/index.xml @@ -8,7 +8,7 @@ <article name="nginx: документация" link="/ru/docs/" lang="ru" - rev="32" + rev="33" toc="no"> @@ -87,6 +87,14 @@ <list type="bullet"> <listitem> +<link doc="stream/stream_processing.xml"/> +</listitem> + +</list> + +<list type="bullet"> + +<listitem> <link url="http://www.aosabook.org/en/nginx.html">Глава “nginx” из книги “The Architecture of Open Source Applications”</link> [en] </listitem>
new file mode 100644 --- /dev/null +++ b/xml/ru/docs/stream/stream_processing.xml @@ -0,0 +1,91 @@ +<!-- + Copyright (C) Nginx, Inc. + --> + +<!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> + +<article name="Как nginx обрабатывает TCP/UDP-сессии" + link="/ru/docs/stream/stream_processing.html" + lang="ru" + rev="1"> + +<section> + +<para> +Обработка клиентской TCP/UDP-сессии происходит +последовательными <b>фазами</b>: + +<list type="tag"> + +<tag-name id="postaccept_phase"> +<literal>Post-accept</literal> +</tag-name> +<tag-desc> +Первая фаза после принятия клиентского соединения. +В этой фазе выполняется модуль +<link doc="ngx_stream_realip_module.xml">ngx_stream_realip_module</link>. +</tag-desc> + +<tag-name id="preaccess_phase"> +<literal>Pre-access</literal> +</tag-name> +<tag-desc> +Предварительная проверка доступа. +В этой фазе выполняется модуль +<link doc="ngx_stream_limit_conn_module.xml">ngx_stream_limit_conn_module</link>. +</tag-desc> + +<tag-name id="access_phase"> +<literal>Access</literal> +</tag-name> +<tag-desc> +Ограничение доступа для клиента перед обработкой данных. +В этой фазе выполняется модуль +<link doc="ngx_stream_access_module.xml">ngx_stream_access_module</link>. +</tag-desc> + +<tag-name id="ssl_phase"> +<literal>SSL</literal> +</tag-name> +<tag-desc> + +Терминирование TLS/SSL. +В этой фазе выполняется модуль +<link doc="ngx_stream_ssl_module.xml">ngx_stream_ssl_module</link>. +</tag-desc> + +<tag-name id="preread_phase"> +<literal>Preread</literal> +</tag-name> +<tag-desc> +Чтение первых байт данных в буфер предварительного чтения +для анализа перед их обработкой +</tag-desc> + +<tag-name id="content_phase"> +<literal>Content</literal> +</tag-name> +<tag-desc> +Обязательная фаза, в которой происходит обработка данных, как правило +<link doc="ngx_stream_proxy_module.xml">проксирование</link> на +<link doc="ngx_stream_upstream_module.xml">группу серверов</link> +или <link doc="ngx_stream_return_module.xml">отправка</link> клиенту +заданного значения. +</tag-desc> + +<tag-name id="log_phase"> +<literal>Log</literal> +</tag-name> +<tag-desc> +Заключительная фаза, +в которой записывается результат обработки клиентской сессии. +В этой фазе выполняется модуль +<link doc="ngx_stream_log_module.xml">ngx_stream_log_module</link>. +</tag-desc> +</list> + +</para> + +</section> + +</article>