Skip to content

Commit 365be9b

Browse files
committed
Optimize sub pool size
1 parent ca312d1 commit 365be9b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/core/xcopy.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ typedef struct tc_sess_s tc_sess_t;
8181
#define TC_UPOOL_MAXV 511
8282
#define TC_DEFAULT_POOL_SIZE (16 * 1024)
8383
#define TC_DEFAULT_UPOOL_SIZE 1024
84-
#define TC_DEFAULT_LR_POOL_SIZE (4 *1024 * 1024)
85-
#define TC_PLUGIN_POOL_SIZE TC_DEFAULT_LR_POOL_SIZE
84+
#define TC_LR_POOL_SIZE (4 *1024 * 1024)
85+
#define TC_LR_POOL_SUB_SIZE (64 *1024)
86+
#define TC_PLUGIN_POOL_SIZE TC_LR_POOL_SIZE
87+
#define TC_PLUGIN_POOL_SUB_SIZE TC_LR_POOL_SUB_SIZE
8688

8789
#define MEM_HID_INFO_SZ sizeof(tc_mem_hid_info_t)
8890
#define TC_POOL_ALIGNMENT 16

src/tcpcopy/tc_session.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ fill_pro_common_header(tc_iph_t *ip, tc_tcph_t *tcp)
198198
int
199199
tc_init_sess_table(void)
200200
{
201-
tc_pool_t *pool = tc_create_pool(TC_DEFAULT_LR_POOL_SIZE, 0, 0);
201+
tc_pool_t *pool = tc_create_pool(TC_LR_POOL_SIZE, TC_LR_POOL_SUB_SIZE, 0);
202202
if (pool != NULL) {
203203
sess_table = hash_create(pool, 65536);
204204
if (sess_table != NULL) {

0 commit comments

Comments
 (0)