From 7450f32351ab408878b022189736544bcdd613d8 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 28 Jan 2014 23:00:28 +0100 Subject: [PATCH] stream: add performance output for stream pools Add info messages at shutdown that give an indication of pool use for the various segment and chunk pools. --- src/stream-tcp-reassemble.c | 6 ++++++ src/stream.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index b3133c27a5..21fc982127 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -490,6 +490,12 @@ void StreamTcpReassembleFree(char quiet) "%"PRIu32"", segment_pool[u16]->empty_stack_size, segment_pool[u16]->alloc_stack_size, segment_pool[u16]->allocated); + + if (segment_pool[u16]->max_outstanding > segment_pool[u16]->allocated) { + SCLogInfo("TCP segment pool of size %u had a peak use of %u segments, " + "more than the prealloc setting of %u", segment_pool_pktsizes[u16], + segment_pool[u16]->max_outstanding, segment_pool[u16]->allocated); + } } PoolFree(segment_pool[u16]); diff --git a/src/stream.c b/src/stream.c index 962530b0b4..34d122d49b 100644 --- a/src/stream.c +++ b/src/stream.c @@ -175,6 +175,13 @@ void StreamMsgQueuesInit(uint32_t prealloc) { } void StreamMsgQueuesDeinit(char quiet) { + if (quiet == FALSE) { + if (stream_msg_pool->max_outstanding > stream_msg_pool->allocated) + SCLogInfo("TCP segment chunk pool had a peak use of %u chunks, " + "more than the prealloc setting of %u", + stream_msg_pool->max_outstanding, stream_msg_pool->allocated); + } + SCMutexLock(&stream_msg_pool_mutex); PoolFree(stream_msg_pool); SCMutexUnlock(&stream_msg_pool_mutex);