use fuser instead of lsof to do health check
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kolla |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
The current health check uses a lot of cpu even on a unloaded system... There is faster ways that uses less cpu...
Reference:
https:/
Current implementation:
#!/bin/bash
process=$1
socket=$2
# lsof truncate command name to 15 characters and this behaviour
# cannot be disabled
if [ ${#process} -gt 15 ] ; then
process=
fi
lsof -Fc -Ua $socket | grep -q "c$process"
---
timing:
time lsof -Fc -Ua /run/openvswitc
real 0m1.571s
And quite a bit of cpu usage...
time fuser /run/openvswitc
real 0m0.007s
Seems more reasonable....
How ever the output format is different.
/run/openvswitc
I assume something like:
pid=$(pidof $1)
socket=$2
fuser $socket |grep -q -E "^\s+$pid$" > /dev/null
---
Would work as a replacement, but it's only a quick hack...
Changed in kolla: | |
importance: | Undecided → Wishlist |
Changed in kolla: | |
status: | New → Triaged |