Bug 596451

Summary: Improve performance on service stop
Product: [Fedora] Fedora Reporter: Gustavo Junior Alves <gjalves>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: iarlyy, jonathan, notting, plautrba, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-28 21:35:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gustavo Junior Alves 2010-05-26 19:00:11 UTC
With a little change in /etc/init.d/functions its possible to improve the shutdown time in about 100ms per service. Can represent more than 1 second in total shutdown time. Just change the usleep from line 308 from 100000 to 1000.

Some lines below, after kill statement, it is possible to reduce by half the waiting after kill, to 50ms. I'm not sure if can be even lower, maybe to just 1ms.

if checkpid $pid 2>&1; then
    # TERM first, then KILL if not dead
    kill -TERM $pid >/dev/null 2>&1
    usleep 1000
    if checkpid $pid && usleep 100000 &&
       checkpid $pid && sleep 1 &&
       checkpid $pid && sleep $delay &&
       checkpid $pid ; then
         kill -KILL $pid >/dev/null 2>&1
         usleep 50000
    fi
fi

Comment 1 Bug Zapper 2010-07-30 11:43:14 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Bill Nottingham 2011-02-28 21:35:06 UTC
I've tweaked this somewhat in rawhide; we'll see what sort feedback we get.