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
a6de1269
Commit
a6de1269
authored
Feb 20, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tweak_bytes() for wthread params.
Reduce stacksize to 32k.
parent
27fd76aa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
25 deletions
+14
-25
params.h
bin/varnishd/common/params.h
+1
-1
mgt_main.c
bin/varnishd/mgt/mgt_main.c
+5
-8
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+1
-1
mgt_param.h
bin/varnishd/mgt/mgt_param.h
+1
-0
mgt_pool.c
bin/varnishd/mgt/mgt_pool.c
+6
-15
No files found.
bin/varnishd/common/params.h
View file @
a6de1269
...
...
@@ -69,7 +69,7 @@ struct params {
unsigned
wthread_fail_delay
;
unsigned
wthread_purge_delay
;
unsigned
wthread_stats_rate
;
unsigned
wthread_stacksize
;
ssize_t
wthread_stacksize
;
unsigned
queue_max
;
...
...
bin/varnishd/mgt/mgt_main.c
View file @
a6de1269
...
...
@@ -406,22 +406,19 @@ main(int argc, char * const *argv)
* Adjust default parameters for 32 bit systems to conserve
* VM space.
*/
MCF_ParamSet
(
cli
,
"workspace_client"
,
"16
384
"
);
MCF_ParamSet
(
cli
,
"workspace_client"
,
"16
k
"
);
cli_check
(
cli
);
MCF_ParamSet
(
cli
,
"workspace_backend"
,
"16
384
"
);
MCF_ParamSet
(
cli
,
"workspace_backend"
,
"16
k
"
);
cli_check
(
cli
);
MCF_ParamSet
(
cli
,
"http_resp_size"
,
"8
192
"
);
MCF_ParamSet
(
cli
,
"http_resp_size"
,
"8
k
"
);
cli_check
(
cli
);
MCF_ParamSet
(
cli
,
"http_req_size"
,
"12
288
"
);
MCF_ParamSet
(
cli
,
"http_req_size"
,
"12
k
"
);
cli_check
(
cli
);
MCF_ParamSet
(
cli
,
"thread_pool_stack"
,
"32bit"
);
cli_check
(
cli
);
MCF_ParamSet
(
cli
,
"gzip_buffer"
,
"4096"
);
MCF_ParamSet
(
cli
,
"gzip_buffer"
,
"4k"
);
cli_check
(
cli
);
}
...
...
bin/varnishd/mgt/mgt_param.c
View file @
a6de1269
...
...
@@ -350,7 +350,7 @@ tweak_generic_bytes(struct cli *cli, volatile ssize_t *dest, const char *arg,
/*--------------------------------------------------------------------*/
static
void
void
tweak_bytes
(
struct
cli
*
cli
,
const
struct
parspec
*
par
,
const
char
*
arg
)
{
volatile
ssize_t
*
dest
;
...
...
bin/varnishd/mgt/mgt_param.h
View file @
a6de1269
...
...
@@ -54,6 +54,7 @@ int tweak_generic_uint(struct cli *cli,
void
tweak_uint
(
struct
cli
*
cli
,
const
struct
parspec
*
par
,
const
char
*
arg
);
void
tweak_timeout
(
struct
cli
*
cli
,
const
struct
parspec
*
par
,
const
char
*
arg
);
void
tweak_bytes
(
struct
cli
*
cli
,
const
struct
parspec
*
par
,
const
char
*
arg
);
/* mgt_pool.c */
extern
const
struct
parspec
WRK_parspec
[];
bin/varnishd/mgt/mgt_pool.c
View file @
a6de1269
...
...
@@ -73,21 +73,13 @@ static void
tweak_stack_size
(
struct
cli
*
cli
,
const
struct
parspec
*
par
,
const
char
*
arg
)
{
unsigned
low
,
u
;
char
buf
[
12
];
ssize_t
low
;
low
=
sysconf
(
_SC_THREAD_STACK_MIN
);
if
(
arg
!=
NULL
&&
!
strcmp
(
arg
,
"32bit"
))
{
u
=
65536
;
if
(
u
<
low
)
u
=
low
;
sprintf
(
buf
,
"%u"
,
u
);
arg
=
buf
;
}
(
void
)
tweak_generic_uint
(
cli
,
&
mgt_param
.
wthread_stacksize
,
arg
,
low
,
(
uint
)
par
->
max
);
tweak_bytes
(
cli
,
par
,
arg
);
if
(
mgt_param
.
wthread_stacksize
<
low
)
mgt_param
.
wthread_stacksize
=
low
;
}
/*--------------------------------------------------------------------*/
...
...
@@ -221,9 +213,8 @@ const struct parspec WRK_parspec[] = {
tweak_stack_size
,
&
mgt_param
.
wthread_stacksize
,
0
,
UINT_MAX
,
"Worker thread stack size.
\n
"
"This is likely rounded up to a multiple of 4k by the kernel.
\n
"
"On 32bit systems you may need to tweak this down to fit "
"many threads into the limited address space.
\n
"
,
"The kernel/OS has a lower limit which will be enforced.
\n
"
,
EXPERIMENTAL
,
"
-1
"
,
"bytes"
},
"
32k
"
,
"bytes"
},
{
NULL
,
NULL
,
NULL
}
};
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