Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
75f057cf
Commit
75f057cf
authored
Sep 27, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the high-level param configuration to mgt_param.c
parent
5d547d79
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
61 deletions
+46
-61
mgt.h
bin/varnishd/mgt/mgt.h
+0
-1
mgt_main.c
bin/varnishd/mgt/mgt_main.c
+1
-48
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+45
-12
No files found.
bin/varnishd/mgt/mgt.h
View file @
75f057cf
...
...
@@ -161,7 +161,6 @@ extern const char C_CLI[]; // CLI traffic between master and child
/* mgt_param.c */
void
MCF_InitParams
(
struct
cli
*
);
void
MCF_CollectParams
(
void
);
enum
mcf_which_e
{
MCF_DEFAULT
=
32
,
MCF_MINIMUM
=
33
,
...
...
bin/varnishd/mgt/mgt_main.c
View file @
75f057cf
...
...
@@ -248,53 +248,6 @@ mgt_Cflag_atexit(void)
/*--------------------------------------------------------------------*/
static
void
init_params
(
struct
cli
*
cli
)
{
ssize_t
def
,
low
;
MCF_CollectParams
();
MCF_TcpParams
();
if
(
sizeof
(
void
*
)
<
8
)
{
/*lint !e506 !e774 */
/*
* Adjust default parameters for 32 bit systems to conserve
* VM space.
*/
MCF_ParamConf
(
MCF_DEFAULT
,
"workspace_client"
,
"24k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"workspace_backend"
,
"16k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"http_resp_size"
,
"8k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"http_req_size"
,
"12k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"gzip_buffer"
,
"4k"
);
MCF_ParamConf
(
MCF_MAXIMUM
,
"vsl_space"
,
"1G"
);
}
#if !defined(HAVE_ACCEPT_FILTERS) || defined(__linux)
MCF_ParamConf
(
MCF_DEFAULT
,
"accept_filter"
,
"off"
);
#endif
low
=
sysconf
(
_SC_THREAD_STACK_MIN
);
MCF_ParamConf
(
MCF_MINIMUM
,
"thread_pool_stack"
,
"%jdb"
,
(
intmax_t
)
low
);
#if defined(WITH_SANITIZERS)
def
=
92
*
1024
;
#else
def
=
48
*
1024
;
#endif
if
(
def
<
low
)
def
=
low
;
MCF_ParamConf
(
MCF_DEFAULT
,
"thread_pool_stack"
,
"%jdb"
,
(
intmax_t
)
def
);
#if !defined(MAX_THREAD_POOLS)
# define MAX_THREAD_POOLS 32
#endif
MCF_ParamConf
(
MCF_MAXIMUM
,
"thread_pools"
,
"%d"
,
MAX_THREAD_POOLS
);
MCF_InitParams
(
cli
);
}
static
void
mgt_tests
(
void
)
{
...
...
@@ -323,7 +276,7 @@ mgt_initialize(struct cli *cli)
mgt_cli_init_cls
();
// CLI commands can be registered
init_p
arams
(
cli
);
MCF_InitP
arams
(
cli
);
cli_check
(
cli
);
}
...
...
bin/varnishd/mgt/mgt_param.c
View file @
75f057cf
...
...
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
...
...
@@ -472,7 +473,7 @@ static struct cli_proto cli_params[] = {
};
/*--------------------------------------------------------------------
*
Wash the min/max/default values, and leave the default set.
*
Configure the parameters
*/
void
...
...
@@ -481,11 +482,54 @@ MCF_InitParams(struct cli *cli)
struct
plist
*
pl
;
struct
parspec
*
pp
;
struct
vsb
*
vsb
;
ssize_t
def
,
low
;
MCF_AddParams
(
mgt_parspec
);
MCF_AddParams
(
WRK_parspec
);
MCF_AddParams
(
VSL_parspec
);
MCF_TcpParams
();
if
(
sizeof
(
void
*
)
<
8
)
{
/*lint !e506 !e774 */
/*
* Adjust default parameters for 32 bit systems to conserve
* VM space.
*/
MCF_ParamConf
(
MCF_DEFAULT
,
"workspace_client"
,
"24k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"workspace_backend"
,
"16k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"http_resp_size"
,
"8k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"http_req_size"
,
"12k"
);
MCF_ParamConf
(
MCF_DEFAULT
,
"gzip_buffer"
,
"4k"
);
MCF_ParamConf
(
MCF_MAXIMUM
,
"vsl_space"
,
"1G"
);
}
#if !defined(HAVE_ACCEPT_FILTERS) || defined(__linux)
MCF_ParamConf
(
MCF_DEFAULT
,
"accept_filter"
,
"off"
);
#endif
low
=
sysconf
(
_SC_THREAD_STACK_MIN
);
MCF_ParamConf
(
MCF_MINIMUM
,
"thread_pool_stack"
,
"%jdb"
,
(
intmax_t
)
low
);
#if defined(WITH_SANITIZERS)
def
=
92
*
1024
;
#else
def
=
48
*
1024
;
#endif
if
(
def
<
low
)
def
=
low
;
MCF_ParamConf
(
MCF_DEFAULT
,
"thread_pool_stack"
,
"%jdb"
,
(
intmax_t
)
def
);
#if !defined(MAX_THREAD_POOLS)
# define MAX_THREAD_POOLS 32
#endif
MCF_ParamConf
(
MCF_MAXIMUM
,
"thread_pools"
,
"%d"
,
MAX_THREAD_POOLS
);
VCLS_AddFunc
(
mgt_cls
,
MCF_AUTH
,
cli_params
);
vsb
=
VSB_new_auto
();
AN
(
vsb
);
VTAILQ_FOREACH
(
pl
,
&
phead
,
list
)
{
pp
=
pl
->
spec
;
...
...
@@ -503,17 +547,6 @@ MCF_InitParams(struct cli *cli)
/*--------------------------------------------------------------------*/
void
MCF_CollectParams
(
void
)
{
MCF_AddParams
(
mgt_parspec
);
MCF_AddParams
(
WRK_parspec
);
MCF_AddParams
(
VSL_parspec
);
}
/*--------------------------------------------------------------------*/
void
MCF_ParamConf
(
enum
mcf_which_e
which
,
const
char
*
param
,
const
char
*
fmt
,
...)
{
...
...
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