Voipmonitor and hugepages: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
Line 61: Line 61:


=Start service=
=Start service=
Before the service started with hugepages, we suggest you to consider/check followin options in voipmonitor.conf
rrd = no
query_cache = no
rtpthreads_start = 8
process_rtp_packets_hash_next_thread = 8
process_rtp_packets_hash_next_thread_max = 16
preprocess_rtp_threads = 4
preprocess_rtp_threads_max = 16
process_rtp_packets_hash_next_thread = 16
preprocess_rtp_threads = 16
threading_mod = 6
t2_boost = yes
destroy_calls_in_storing_cdr = yes
max_buffer_mem                  = 160000
pre_process_packets_next_thread = 3
pre_process_packets_next_thread_max = 16
process_rtp_packets_qring_push_usleep = 10
preprocess_packets_qring_usleep = 10
preprocess_packets_qring_length = 20
preprocess_packets_qring_item_length = 2000
preprocess_packets_qring_push_usleep = 10
process_rtp_packets_qring_usleep = 10
process_rtp_packets_qring_length = 20
process_rtp_packets_qring_item_length = 2000
sip_tcp_reassembly_ext_quick_mod = ext
opt_sip_tcp_reassembly_ext_usleep = 5
cpu_limit_new_thread = 85
cpu_limit_new_thread_high = 95
hash_queue_length_ms = 2000
cleanup_calls_period = 60
memory_purge_interval = 0
Then enabling the service(start afterbootup) and starting the service can be done:
  systemctl enable voipmonitor.service
  systemctl enable voipmonitor.service
  systemctl start voipmonitor.service
  systemctl start voipmonitor.service

Revision as of 16:35, 14 March 2022

Modifications before build

define.h

source file of voipmonitor sniffers needs to be altered first

Modify

#define MAX_PRE_PROCESS_PACKET_NEXT_THREADS 16
#define MAX_PROCESS_RTP_PACKET_HASH_NEXT_THREADS 16

Add

#define EXPERIMENTAL_T2_DETACH_X_MOD true
#define EXPERIMENTAL_T2_DIRECT_RTP_PUSH true
#define EXPERIMENTAL_T2_QUEUE_FULL_STAT true
#define EXPERIMENTAL_SUPPRESS_AUDIOCODES true
#define EXPERIMENTAL_SUPPRESS_KAMAILIO true
#define EXPERIMENTAL_SUPPRESS_CALL_CONFIRMATION_FOR_RTP_PROCESSING true
#define EXPERIMENTAL_PRECREATION_RTP_HASH_INDEX true
#define EXPERIMENTAL_SUPPRESS_AST_CHANNELS true
#define EXPERIMENTAL_LITE_RTP_MOD true

Makefile

after configure you need to modify the Makefile produced (in 2022-03-14)

architecture set to native

Change architecture to native

ifeq ($(GCCARCH),x86_64)
  GCCARCH = native
  MTUNE = -mtune=native
endif

change optimizers flag

Change from -O2 to -O3

CXXFLAGS +=  -Wall -fPIC -g3 -O3 -march=$(GCCARCH) ${MTUNE} ${INCLUDES} ${FBSDDEF} ${MYSQL_WITHOUT_SSL_SUPPORT}


Modifications before service start

create init_hugepages script

Create the /etc/init.d/init_hugepages script. Don't forget to set executable flag (chmod +x init_hugepages)

#!/bin/bash
echo 1 > /proc/sys/vm/drop_caches
echo 1 > /proc/sys/vm/compact_memory
echo 0 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
echo 60000 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages

voipmonitor.service

service file for systemd located in /etc/systemd/system

[Unit]
Description=VoIPmonitor sniffer

[Service]
Type=simple
PIDFile=/var/run/voipmonitor.pid
Environment=TCMALLOC_MEMFS_MALLOC_PATH=/dev/hugepages/test
ExecStartPre=/usr/local/sbin/init_hugepages
ExecStart=/usr/bin/numactl --cpunodebind=1 --membind=1 /usr/local/sbin/voipmonitor --config-file=/etc/voipmonitor.conf -k -v1,pcap_stat_period=5

[Install]
WantedBy=multi-user.target

Start service

Before the service started with hugepages, we suggest you to consider/check followin options in voipmonitor.conf

rrd = no
query_cache = no
rtpthreads_start = 8
process_rtp_packets_hash_next_thread = 8
process_rtp_packets_hash_next_thread_max = 16
preprocess_rtp_threads = 4
preprocess_rtp_threads_max = 16
process_rtp_packets_hash_next_thread = 16
preprocess_rtp_threads = 16

threading_mod = 6
t2_boost = yes
destroy_calls_in_storing_cdr = yes
max_buffer_mem                  = 160000

pre_process_packets_next_thread = 3
pre_process_packets_next_thread_max = 16
process_rtp_packets_qring_push_usleep = 10
preprocess_packets_qring_usleep = 10
preprocess_packets_qring_length = 20
preprocess_packets_qring_item_length = 2000
preprocess_packets_qring_push_usleep = 10
process_rtp_packets_qring_usleep = 10
process_rtp_packets_qring_length = 20
process_rtp_packets_qring_item_length = 2000
sip_tcp_reassembly_ext_quick_mod = ext
opt_sip_tcp_reassembly_ext_usleep = 5
cpu_limit_new_thread = 85
cpu_limit_new_thread_high = 95
hash_queue_length_ms = 2000
cleanup_calls_period = 60
memory_purge_interval = 0


Then enabling the service(start afterbootup) and starting the service can be done:

systemctl enable voipmonitor.service
systemctl start voipmonitor.service

Coredump file create change

Choose location where is enough space for credumps (coredumps may be huge depends on how much RAM were allocated by the sniffer process)

echo "/media/voipmonitor/sniffer01/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern