groupadd / useradd significantly slowed down compared to centos 7

Issues related to applications and software problems and general support
Post Reply
kiuka
Posts: 2
Joined: 2018/09/03 22:04:24

groupadd / useradd significantly slowed down compared to centos 7

Post by kiuka » 2021/12/31 18:44:58

Hey guys,

I'm migrating from CentOS 7 to 8 and I have noticed that adding users and groups to the system slowed down significantly.

I created a test, installed a fresh CentOS 7 and 8 and added the same script which created 10k groups (using the same hw, cpu/memory, everything).

CentOS 7 was consistently giving me the same performance, groupadd took around 0.03 - 0.07sec, meanwhile in CentOS 8 it started with 0.3 (which already 10x slower than in version 7) and it quickly raised to 1s. More the groups I added the slower it got (after a few thousands it took 6-7sec to add even one group).

I went through the major changes between the versions but nothing caught my eyes that would indicate this.

My test script:

Code: Select all

#!/bin/bash
for i in `seq 10000 20000`;
do
   USERNAME="u$i"
   echo $USERNAME
   time groupadd --gid $i $USERNAME
done
I have attached the straces, the difference can be found around the end of it (centos 8 has another wait block that consumes the time as opposed to the 7)

I wanted to give an easy to run example, so I tried to reproduce it using docker, but when I run it inside a container CentOS 8 is the same fast as the 7, so I guess something extra is running as default that I dont know about.

Anybody has any idea how could I get the same performance in CentOS 8? Thanks a lot!

Post Reply