Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: vdavydov.dev@gmail.com
Subject: [PATCH 0/3] iproto: allow to configure IPROTO_MSG_MAX
Date: Sat, 21 Apr 2018 01:52:08 +0300	[thread overview]
Message-ID: <cover.1524264351.git.v.shpilevoy@tarantool.org> (raw)

Branch: http://github.com/tarantool/tarantool/tree/gh-3320-config-msg-max
Issue: https://github.com/tarantool/tarantool/issues/3320

IPROTO_MSG_MAX is a constant that restricts count of requests in fly. It allows
to do not produce too many fibers in TX thread, that would lead to too big
overhead on fibers switching, their stack storing.

But some users have powerful metal on which Tarantool IPROTO_MSG_MAX constant is
not serious. The patch exposes it as a configuration runtime parameter.

'iproto_msg_max' is its name. If a user sees that IProto thread is stuck due to
too many requests, it can change iproto_msg_max in runtime, and IProto thread
immediately starts processing pending requests.

'iproto_msg_max' can be decreased, but obviously it can not stop already runned
requests, so if now in IProto thread request count is > new 'iproto_msg_max'
value, then it takes some time until some requests will be finished.

In the same patchset a bug is fixed with incorrect discarding long-poll requests
input. Discard just calls iproto_resume() trying to notify libev, that is can
get new data. But is makes no sense, because iproto_resume() continues only
connections stopped due to reached limit of maximal requests in fly, but not
connections whose buffer is overflowed. Such stopped connections can be
continued only after a request is complete.

To continue read from the connection whose buffer was freed by discarding
long-poll it is necessary to explicitly feed to it EV_READ event. On this event iproto_connection_on_input will read a blocked data if it exists.

Vladislav Shpilevoy (3):
  iproto: rename iproto_bind_msg to iproto_cfg_msg
  iproto: fix error with input discarding
  iproto: allow to configure IPROTO_MSG_MAX

 src/box/box.cc                  |   7 ++
 src/box/box.h                   |   1 +
 src/box/iproto.cc               |  79 ++++++++++----
 src/box/iproto.h                |   3 +
 src/box/lua/cfg.cc              |  12 +++
 src/box/lua/load_cfg.lua        |   3 +
 test/app-tap/init_script.result |  73 ++++++-------
 test/box/admin.result           |   2 +
 test/box/cfg.result             |  24 +++++
 test/box/cfg.test.lua           |   9 ++
 test/box/request_limit.result   | 229 ++++++++++++++++++++++++++++++++++++++++
 test/box/request_limit.test.lua | 114 ++++++++++++++++++++
 12 files changed, 500 insertions(+), 56 deletions(-)
 create mode 100644 test/box/request_limit.result
 create mode 100644 test/box/request_limit.test.lua

-- 
2.15.1 (Apple Git-101)

             reply	other threads:[~2018-04-20 22:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 22:52 Vladislav Shpilevoy [this message]
     [not found] ` <cover.1524264646.git.v.shpilevoy@tarantool.org>
2018-04-20 22:52   ` [PATCH 1/3] iproto: rename iproto_bind_msg to iproto_cfg_msg Vladislav Shpilevoy
2018-04-23 11:22     ` Vladimir Davydov
2018-04-23 17:00       ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-20 22:52   ` [PATCH 2/3] iproto: fix error with input discarding Vladislav Shpilevoy
2018-04-23 11:20     ` Vladimir Davydov
2018-04-20 22:52   ` [PATCH 3/3] iproto: allow to configure IPROTO_MSG_MAX Vladislav Shpilevoy
2018-04-23 11:34     ` Vladimir Davydov
2018-04-23 17:00       ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-24  8:04         ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1524264351.git.v.shpilevoy@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH 0/3] iproto: allow to configure IPROTO_MSG_MAX' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox