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
6a92b339
Commit
6a92b339
authored
Dec 02, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a session workspace for the TCP addresses etc.
parent
146d1035
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
20 deletions
+22
-20
cache.h
bin/varnishd/cache/cache.h
+2
-0
cache_session.c
bin/varnishd/cache/cache_session.c
+11
-19
params.h
bin/varnishd/common/params.h
+2
-1
mgt_param_tbl.c
bin/varnishd/mgt/mgt_param_tbl.c
+7
-0
No files found.
bin/varnishd/cache/cache.h
View file @
6a92b339
...
...
@@ -766,6 +766,8 @@ struct sess {
/* Session related fields ------------------------------------*/
struct
ws
ws
[
1
];
struct
suckaddr
*
remote_addr
;
struct
suckaddr
*
local_addr
;
...
...
bin/varnishd/cache/cache_session.c
View file @
6a92b339
...
...
@@ -51,8 +51,6 @@
#include "vtcp.h"
#include "vtim.h"
static
unsigned
ses_size
;
/*--------------------------------------------------------------------*/
struct
sesspool
{
...
...
@@ -94,34 +92,28 @@ SES_Charge(struct worker *wrk, struct req *req)
*
* Layout is:
* struct sess
* struct vsa (local_addr)
* struct vsa (remote_addr)
* workspace
*/
static
struct
sess
*
ses_new
(
struct
sesspool
*
pp
)
{
struct
sess
*
sp
;
char
*
s
;
unsigned
sz
;
char
*
p
,
*
e
;
CHECK_OBJ_NOTNULL
(
pp
,
SESSPOOL_MAGIC
);
sp
=
MPL_Get
(
pp
->
mpl_sess
,
&
sz
);
sp
->
magic
=
SESS_MAGIC
;
sp
->
sesspool
=
pp
;
s
=
(
char
*
)
sp
;
s
+=
sizeof
*
sp
;
memset
(
s
,
0
,
vsa_suckaddr_len
);
sp
->
local_addr
=
(
void
*
)
s
;
s
+=
vsa_suckaddr_len
;
memset
(
s
,
0
,
vsa_suckaddr_len
);
sp
->
remote_addr
=
(
void
*
)
s
;
s
+=
vsa_suckaddr_len
;
assert
((
char
*
)
sp
+
sz
==
s
);
e
=
(
char
*
)
sp
+
sz
;
p
=
(
char
*
)(
sp
+
1
);
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
e
);
WS_Init
(
sp
->
ws
,
"sess"
,
p
,
e
-
p
);
sp
->
local_addr
=
(
void
*
)
WS_Alloc
(
sp
->
ws
,
vsa_suckaddr_len
);
sp
->
remote_addr
=
(
void
*
)
WS_Alloc
(
sp
->
ws
,
vsa_suckaddr_len
);
sp
->
t_open
=
NAN
;
sp
->
t_idle
=
NAN
;
...
...
@@ -454,8 +446,8 @@ SES_NewPool(struct pool *wp, unsigned pool_no)
pp
->
mpl_req
=
MPL_New
(
nb
,
&
cache_param
->
req_pool
,
&
cache_param
->
workspace_client
);
bprintf
(
nb
,
"sess%u"
,
pool_no
);
ses_size
=
sizeof
(
struct
sess
)
+
vsa_suckaddr_len
*
2L
;
pp
->
mpl_sess
=
MPL_New
(
nb
,
&
cache_param
->
sess_pool
,
&
ses_size
);
pp
->
mpl_sess
=
MPL_New
(
nb
,
&
cache_param
->
sess_pool
,
&
cache_param
->
workspace_session
);
return
(
pp
);
}
...
...
bin/varnishd/common/params.h
View file @
6a92b339
...
...
@@ -89,8 +89,9 @@ struct params {
unsigned
wthread_queue_limit
;
/* Memory allocation hints */
unsigned
workspace_client
;
unsigned
workspace_backend
;
unsigned
workspace_client
;
unsigned
workspace_session
;
unsigned
workspace_thread
;
unsigned
vsl_buffer
;
...
...
bin/varnishd/mgt/mgt_param_tbl.c
View file @
6a92b339
...
...
@@ -81,6 +81,13 @@ struct parspec mgt_parspec[] = {
"cache at the end of ttl+grace+keep."
,
OBJ_STICKY
,
"0"
,
"seconds"
},
{
"workspace_session"
,
tweak_bytes_u
,
&
mgt_param
.
workspace_session
,
"256"
,
NULL
,
"Bytes of workspace for session and TCP connection addresses."
" If larger than 4k, use a multiple of 4k for VM efficiency."
,
DELAYED_EFFECT
,
"512"
,
"bytes"
},
{
"workspace_client"
,
tweak_bytes_u
,
&
mgt_param
.
workspace_client
,
"3072"
,
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