Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
f004361e
Commit
f004361e
authored
Jan 13, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add --backend-request-buffer option
parent
d6db38a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
src/shrpx.cc
src/shrpx.cc
+11
-0
src/shrpx_config.cc
src/shrpx_config.cc
+8
-2
src/shrpx_config.h
src/shrpx_config.h
+2
-0
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+1
-1
No files found.
src/shrpx.cc
View file @
f004361e
...
...
@@ -747,6 +747,7 @@ void fill_default_config() {
mod_config
()
->
listener_disable_timeout
=
0.
;
mod_config
()
->
auto_tls_ticket_key
=
true
;
mod_config
()
->
tls_ctx_per_worker
=
false
;
mod_config
()
->
downstream_request_buffer_size
=
16
*
1024
;
mod_config
()
->
downstream_response_buffer_size
=
64
*
1024
;
}
}
// namespace
...
...
@@ -878,6 +879,11 @@ Performance:
Set maximum number of open files (RLIMIT_NOFILE) to <N>.
If 0 is given, nghttpx does not set the limit.
Default: )"
<<
get_config
()
->
rlimit_nofile
<<
R"(
--backend-request-buffer=<SIZE>
Set buffer size used to store backend request.
Default: )"
<<
util
::
utos_with_unit
(
get_config
()
->
downstream_request_buffer_size
)
<<
R"(
--backend-response-buffer=<SIZE>
Set buffer size used to store backend response.
Default: )"
...
...
@@ -1280,6 +1286,7 @@ int main(int argc, char **argv) {
{
"rlimit-nofile"
,
required_argument
,
&
flag
,
69
},
{
"tls-ctx-per-worker"
,
no_argument
,
&
flag
,
70
},
{
"backend-response-buffer"
,
required_argument
,
&
flag
,
71
},
{
"backend-request-buffer"
,
required_argument
,
&
flag
,
72
},
{
nullptr
,
0
,
nullptr
,
0
}};
int
option_index
=
0
;
...
...
@@ -1605,6 +1612,10 @@ int main(int argc, char **argv) {
// --backend-response-buffer
cmdcfgs
.
emplace_back
(
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
,
optarg
);
break
;
case
72
:
// --backend-request-buffer
cmdcfgs
.
emplace_back
(
SHRPX_OPT_BACKEND_REQUEST_BUFFER
,
optarg
);
break
;
default:
break
;
}
...
...
src/shrpx_config.cc
View file @
f004361e
...
...
@@ -141,6 +141,7 @@ const char SHRPX_OPT_LISTENER_DISABLE_TIMEOUT[] = "listener-disable-timeout";
const
char
SHRPX_OPT_TLS_TICKET_KEY_FILE
[]
=
"tls-ticket-key-file"
;
const
char
SHRPX_OPT_RLIMIT_NOFILE
[]
=
"rlimit-nofile"
;
const
char
SHRPX_OPT_TLS_CTX_PER_WORKER
[]
=
"tls-ctx-per-worker"
;
const
char
SHRPX_OPT_BACKEND_REQUEST_BUFFER
[]
=
"backend-request-buffer"
;
const
char
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
[]
=
"backend-response-buffer"
;
namespace
{
...
...
@@ -1118,7 +1119,8 @@ int parse_config(const char *opt, const char *optarg) {
return
0
;
}
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
))
{
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_BACKEND_REQUEST_BUFFER
)
||
util
::
strieq
(
opt
,
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
))
{
size_t
n
;
if
(
parse_uint_with_unit
(
&
n
,
opt
,
optarg
)
!=
0
)
{
return
-
1
;
...
...
@@ -1130,7 +1132,11 @@ int parse_config(const char *opt, const char *optarg) {
return
-
1
;
}
mod_config
()
->
downstream_response_buffer_size
=
n
;
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_BACKEND_REQUEST_BUFFER
))
{
mod_config
()
->
downstream_request_buffer_size
=
n
;
}
else
{
mod_config
()
->
downstream_response_buffer_size
=
n
;
}
return
0
;
}
...
...
src/shrpx_config.h
View file @
f004361e
...
...
@@ -129,6 +129,7 @@ extern const char SHRPX_OPT_LISTENER_DISABLE_TIMEOUT[];
extern
const
char
SHRPX_OPT_TLS_TICKET_KEY_FILE
[];
extern
const
char
SHRPX_OPT_RLIMIT_NOFILE
[];
extern
const
char
SHRPX_OPT_TLS_CTX_PER_WORKER
[];
extern
const
char
SHRPX_OPT_BACKEND_REQUEST_BUFFER
[];
extern
const
char
SHRPX_OPT_BACKEND_RESPONSE_BUFFER
[];
union
sockaddr_union
{
...
...
@@ -257,6 +258,7 @@ struct Config {
size_t
padding
;
size_t
worker_frontend_connections
;
size_t
rlimit_nofile
;
size_t
downstream_request_buffer_size
;
size_t
downstream_response_buffer_size
;
// Bit mask to disable SSL/TLS protocol versions. This will be
// passed to SSL_CTX_set_options().
...
...
src/shrpx_downstream.cc
View file @
f004361e
...
...
@@ -443,7 +443,7 @@ void Downstream::set_request_http2_expect_body(bool f) {
bool
Downstream
::
request_buf_full
()
{
if
(
dconn_
)
{
return
request_buf_
.
rleft
()
>=
16384
;
return
request_buf_
.
rleft
()
>=
get_config
()
->
downstream_request_buffer_size
;
}
else
{
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment