Skip to content

ossec-authd performance issues when generating large number of keys (20k+ )  #873

@avisri

Description

@avisri

ossec-authd is taking 60 sec + to generate client keys when generating id >20k client key and uses up 80%-100% of Cpu / core/ request on a 8 core system (vm) .

Was able to reproduce -

use a windows or a mac client (s) ( one /server core ) to keep requesting key .
You can queue upto 512

count=0
while true ; 
do 
   testhost=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) 
   # replace authserver with test auth server name /ip  
   time  bin/agent-auth -m <authserver> -p 1515 -A $count-$testhost
   ((count++))
done

server side mods:

# checkout src  and reconfigure max agents and reinstall
cd src/ ; 
#make sure you have this patch if you are on a older branch 
# https://github.com/ossec/ossec-hids/commit/5e41e53c31b6553873d26e06c9be299598c99cc5
echo "50000"| make setmaxagents; ../install.sh 
# alternatively make all and just copy new ossec-authd  bin to your installation location (/var/ossec/bin) 

#run it 
bin/ossec-authd  -d 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions