bin/98693: Reduce NIS server loading
Gea-Suan Lin
gslin at csie.nctu.edu.tw
Thu Jun 8 02:11:48 PDT 2006
>Number: 98693
>Category: bin
>Synopsis: Reduce NIS server loading
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jun 08 07:10:11 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Gea-Suan Lin
>Release: FreeBSD 6.1-STABLE i386
>Organization:
>Environment:
System: FreeBSD ccbsd3.csie.nctu.edu.tw 6.1-STABLE FreeBSD 6.1-STABLE #2: Thu Jun 8 06:24:03 CST 2006 root at ccbsd3.csie.nctu.edu.tw:/usr/obj/usr/src/sys/CCBSD3 i386
>Description:
If there are a lot of users (> 10k) in NIS, then running top causes
NIS server high load.
>How-To-Repeat:
>Fix:
--- /usr/src/usr.bin/top/machine.c Wed May 18 21:42:51 2005
+++ machine.c Thu Jun 8 12:32:56 2006
@@ -62,7 +62,7 @@
int swapmode(int *retavail, int *retfree);
static int smpmode;
enum displaymodes displaymode;
-static int namelength = 8;
+static int namelength = UPUNAMELEN;
static int cmdlengthdelta;
/* Prototypes for top internals */
@@ -235,14 +235,8 @@
modelen != sizeof(smpmode))
smpmode = 0;
- while ((pw = getpwent()) != NULL) {
- if (strlen(pw->pw_name) > namelength)
- namelength = strlen(pw->pw_name);
- }
if (smpmode && namelength > SMPUNAMELEN)
namelength = SMPUNAMELEN;
- else if (namelength > UPUNAMELEN)
- namelength = UPUNAMELEN;
kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open");
if (kd == NULL)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list