The Samba-Bugzilla – Attachment 6498 Details for
Bug 8184
ctdb 50.samba event script monitoring is expensive under heavy load
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
1.0.112 based patch
0001-sh-make-ctdb_check_tcp_ports-more-efficient.patch (text/plain), 1.41 KB, created by
David Disseldorp
on 2011-05-29 22:56:09 UTC
(
hide
)
Description:
1.0.112 based patch
Filename:
MIME Type:
Creator:
David Disseldorp
Created:
2011-05-29 22:56:09 UTC
Size:
1.41 KB
patch
obsolete
>From 381da0b83828e07ead15c5c1b40fea6ed804c0b7 Mon Sep 17 00:00:00 2001 >From: David Disseldorp <ddiss@suse.de> >Date: Mon, 30 May 2011 00:40:23 +0200 >Subject: [PATCH] sh: make ctdb_check_tcp_ports more efficient > >Under an intensive connect-disconnect workload, the number of sockets in >the TIME_WAIT state can easily reach several thousand, as a result the >netstat command takes a long time (~5s x 4 runs = ~20s) to complete and >is CPU intensive. > >https://bugzilla.samba.org/show_bug.cgi?id=8184 >--- > config/functions | 10 ++++++---- > 1 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/config/functions b/config/functions >index e0d0735..bbfbe9f 100755 >--- a/config/functions >+++ b/config/functions >@@ -176,15 +176,17 @@ ctdb_check_directories() { > # usage: ctdb_check_tcp_ports <ports...> > ###################################################### > ctdb_check_tcp_ports() { >- >- for p ; do >- if ! netstat -a -t -n | grep -q "0\.0\.0\.0:$p .*LISTEN" ; then >- if ! netstat -a -t -n | grep -q ":::$p .*LISTEN" ; then >+ tmp_file=`mktemp` || return 1 >+ netstat -l -t -n > $tmp_file >+ for p in "$@"; do >+ if ! grep -q "0\.0\.0\.0:$p .*LISTEN" $tmp_file ; then >+ if ! grep -q ":::$p .*LISTEN" $tmp_file ; then > echo "ERROR: $service_name tcp port $p is not responding" > return 1 > fi > fi > done >+ rm -f $tmp_file > } > > ###################################################### >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8184
: 6498