Search code examples
dockerjmetercontainerd

Jmeter keeps running in containerd-shim everytime docker is started. how to completely remove it?


I used jmeter once last year for web performance testing. I didn't realize it keeps running until my colleague told me the staging env keeps getting huge API accesses.

After some investigation, turns out the jmeter in my machine (it runs Ubuntu 22.04) keeps running inside containerd-shim. When I checked, turns out everytime I turn on Docker in my local using command sudo systemctl start docker, it also runs the containerd-shim and jmeter when I checked using ps aux | grep jmeter and pstree -p | grep jmeter

I tried to kill all the jmeter pids but they keep restarting. sudo kill -9 [pid]. I tried to check the docker container docker ps -a and images docker images but they're empty.

If I stop the containerd using sudo systemctl stop containerd, it stopped the jmeter too. But if I run the docker again, the jmeter starts again.

I want to know how to stop and completely remove this jmeter from containerd process?

irene@irene-OP-LP2:~$ ps aux | grep jmeter
root       21933  0.0  0.0   2220  1584 ?        Ss   11:30   0:00 bash /jmeter/bin/run-lp-endpoint-tests.sh
root       21966  0.0  0.0   1584   888 ?        S    11:30   0:00 /bin/sh /opt/apache-jmeter-5.4.2/bin/jmeter -n -t /jmeter/tests/z-api/lp-endpoints.jmx -l log -f -e -o output/results -JtestGroup= -Jhost= -Jprotocol= -Jport= -Jthreads= -JloopCount=
root       22008  4.8  0.7 2597216 186152 ?      Sl   11:30   0:05 /usr/bin/java -server -XX:+HeapDumpOnOutOfMemoryError -Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20 -Djava.security.egd=file:/dev/urandom -Duser.language=en -Duser.region=EN -jar /opt/apache-jmeter-5.4.2/bin/ApacheJMeter.jar -n -t /jmeter/tests/z-api/lp-endpoints.jmx -l log -f -e -o output/results -JtestGroup= -Jhost= -Jprotocol= -Jport= -Jthreads= -JloopCount=
irene      22123  0.0  0.0  10124  2400 pts/0    S+   11:32   0:00 grep --color=auto jmeter

irene@irene-OP-LP2:~$ pstree -p | grep jmeter
           |-containerd-shim(21912)-+-bash(21933)---jmeter(21966)---java(22008)-+-{java}(22009)

Solution

  • It looks like your restart policy is configured in a way which keeps jmeter container running when the docker (or other container engine) is running

    Simply update your container and disable automatic start:

    docker update --restart no your-jmeter-container-name
    docker stop your-jmeter-container-name
    

    More information: How to Use Docker with JMeter