CPU utilization always on 100%
Hello,
while using ipfixprobe 4.16.0 I noticed that the program eats the whole CPU. I tested raw and pcap inputs. This happens regardless of cache or processor plugins. I am not sure if it is a bug or a design decision.
I am using ipfixprobe on Ubuntu 22.04 built from source.
Hello,
I was unable to reproduce the issue you described. Could you please provide a more detailed description of your setup, especially the output configuration, which you haven't mentioned? This information would help in diagnosing the problem.
I tried running ipfixprobe with both raw and pcap inputs, but I didn't encounter the issue. Here are my results:
sudo ./ipfixprobe -i "raw;ifc=ens192"
$ top
%CPU %MEM COMMAND
8.3. 1.7 ipfixprobe
sudo ./ipfixprobe -i "pcap;ifc=ens192"
$ top
%CPU %MEM COMMAND
9.6 1.9 ipfixprobe
Here is my build script in Docker.
Click to open
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
ARG BUILD_PREFIX=/builds/build/
RUN mkdir -p ${BUILD_PREFIX}
ARG CLONE_DIR=/builds/clone
RUN mkdir -p ${CLONE_DIR}
#######################
# COMBINED DEPENDENCIES
#######################
RUN apt-get update
RUN apt-get -y install git build-essential autoconf libtool libpcap-dev pkg-config libxml2-dev libunwind-dev libfuse3-dev fuse3 cmake liblz4-dev rpm libssl-dev
#######
# NEMEA
#######
ARG NEMEA_VERSION=v2.1.5
RUN git clone -b ${NEMEA_VERSION} --depth 1 https://github.com/CESNET/nemea-framework ${CLONE_DIR}/nemea-framework
WORKDIR ${CLONE_DIR}/nemea-framework
RUN ./bootstrap.sh
RUN ./configure --prefix=${BUILD_PREFIX} -q
RUN make -j10
RUN make install
###########
# TELEMETRY
###########
ARG TELEMETRY_VERSION=release
RUN git clone -b ${TELEMETRY_VERSION} --depth 1 https://github.com/CESNET/telemetry ${CLONE_DIR}/telemetry
RUN mkdir -p ${CLONE_DIR}/telemetry/build
WORKDIR ${CLONE_DIR}/telemetry/build
RUN cmake -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} ..
RUN make -j10
RUN make install
############
# IPFIXPROBE
############
ARG IPFIXPROBE_VERSION=4.16.0
ARG IPFIXPROBE_TAG=v${IPFIXPROBE_VERSION}
RUN git clone -b ${IPFIXPROBE_TAG} --depth 1 https://github.com/CESNET/ipfixprobe.git ${CLONE_DIR}/ipfixprobe
WORKDIR ${CLONE_DIR}/ipfixprobe
ARG CPPFLAGS="-I${BUILD_PREFIX}/include"
ARG LDFLAGS="-L${BUILD_PREFIX}/lib"
RUN autoreconf -i
RUN ./configure --with-msects --with-pcap --prefix=${BUILD_PREFIX}
RUN make
RUN make install
################
# DEBIAN PACKAGE
################
ARG VERSION_SUFFIX=1
ARG PACKAGE_VERSION=${IPFIXPROBE_VERSION}-${VERSION_SUFFIX}
ARG PACKAGE_PATH=/builds/debian
ARG DEBIAN_PATH=/builds/
WORKDIR ${DEBIAN_PATH}
RUN mkdir -p ${PACKAGE_PATH}/usr ${PACKAGE_PATH}/DEBIAN ${DEBIAN_PATH}
RUN cp -r ${BUILD_PREFIX}/etc ${PACKAGE_PATH}/etc
RUN cp -r ${BUILD_PREFIX}/bin ${PACKAGE_PATH}/bin
RUN cp -r ${BUILD_PREFIX}/lib ${PACKAGE_PATH}/usr/lib
RUN cp -r ${BUILD_PREFIX}/include ${PACKAGE_PATH}/usr/include
RUN cp -r ${BUILD_PREFIX}/share ${PACKAGE_PATH}/usr/share
COPY control ${PACKAGE_PATH}/DEBIAN/control
RUN sed -i "s/PACKAGE_VERSION/${PACKAGE_VERSION}/" ${PACKAGE_PATH}/DEBIAN/control
RUN dpkg-deb --build ${PACKAGE_PATH} ${DEBIAN_PATH}/ipfixprobe.deb
#######
# FINAL
#######
WORKDIR /
ipfixprobe eaths the whole CPU regardless of output, processing, or enabled cache. It happens in both:
ipfixprobe -i 'pcap;i=ens3'
ipfixprobe -i 'raw;ifc=ens3'
I ran it in a virtual machine with Ubuntu 22.04. I suspect the issue is with my build script. Maybe ipfixprobe requires specific versions of libraries? If you provided me with a build script for the new unreleased version 5.0.0 then I could try to run it.
I tried reproducing the issue in a fresh Docker container based on ubuntu:22.04, and everything worked fine on my side — no abnormal CPU usage when running ipfixprobe with either the pcap or raw plugin.
Here’s the exact sequence of commands I used to build and run ipfixprobe (version from the latest master branch):
apt-get update
apt-get -y install git build-essential libpcap-dev libunwind-dev libfuse3-dev fuse3 cmake liblz4-dev libssl-dev rpm
git clone https://github.com/CESNET/ipfixprobe.git
cd ipfixprobe
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_INPUT_PCAP=ON -DENABLE_MILISECONDS_TIMESTAMP=ON
cd build
make -j$(nproc)
make install
ipfixprobe -i "raw;ifc=ens3"
Let me know if the high CPU usage persists after trying this clean build.
Pavel
I believe this can be closed. I have failed to replicate the issue on my end. Thanks for your help.