Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Oct 2004 09:20:04 +0300
From:      "donatas" <donatas@lrtc.net>
To:        <freebsd-net@freebsd.org>
Subject:   enormous CPU load on 4.10 machine
Message-ID:  <00dc01c4ac35$af0067a0$9f90a8c0@donatas>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_00D8_01C4AC4E.D44673B0
Content-Type: text/plain;
	charset="windows-1257"
Content-Transfer-Encoding: quoted-printable

hello,
i've made a simple script for correcting about 2000 user files on 30 =
routers from the database.
must notice that it works fine, but only on 5.2 Machines.
on 4.8 4.9 and 4.10 it "eats" all the cpu resources. On both(4.10 an =
5.2.1) machines there is similar count of IPFW rules and both FreeBsd =
versions run on similar machines
(Intel SE7501WV2 Server Board +Xeon 2.4 HT enabled +512Mb RAM +Barracuda =
120Gb)

on many of those machines we are transporting internet traffic to hudge =
companies and hundres of users and leaving machines with 100% cpu load =
for 4 hours is not a solution.
so what might be the cause of such scripting perfomance difference =
between 4.10 and 5.2.1

thanks for help
________________________________TOP ON =
5.2.1____________________________________________________
last pid: 20648;  load averages:  0.49,  0.19,  0.06                     =
                                  up 31+19:26:49  09:00:26
51 processes:  5 running, 46 sleeping
CPU states: 11.2% user,  0.0% nice, 39.8% system,  5.5% interrupt, 43.5% =
idle (92.7% idle before loading the script)
Mem: 26M Active, 185M Inact, 98M Wired, 60M Buf, 185M Free
Swap: 999M Total, 999M Free

  PID USERNAME  PRI NICE   SIZE    RES STATE  C   TIME   WCPU    CPU =
COMMAND
16653 root      111    0   940K   664K RUN    1   0:01 10.27%  4.64% sh
38797 root       96    0 12076K 11572K select 1  67:45  0.00%  0.00% =
ospfd
 5706 root        8  -20   956K   664K wait   0  23:09  0.00%  0.00% sh
38795 root       96    0  2488K  1980K select 0  20:00  0.00%  0.00% =
ripd
 5714 root       96    0  4072K  3752K select 0   6:18  0.00%  0.00% =
snmpd
49772 root       96    0  1400K   796K select 0   1:17  0.00%  0.00% =
ping
  688 root       96    0  3488K  2428K select 0   0:30  0.00%  0.00% =
sshd
38793 root       96    0  2972K  2460K select 0   0:23  0.00%  0.00% =
zebra
  706 root        8    0  1336K  1008K nanslp 0   0:09  0.00%  0.00% =
cron
  543 root       96    0  1312K   832K select 0   0:07  0.00%  0.00% =
syslogd
26424 maris      96    0  6220K  2956K select 1   0:01  0.00%  0.00% =
sshd
 8568 root       96    0  4596K  3104K select 0   0:00  0.00%  0.00% mc
26439 root        5    0  1392K  1212K ttyin  1   0:00  0.00%  0.00% =
bash
 8564 donatas    96    0  6220K  2956K select 0   0:00  0.00%  0.00% =
sshd
 9927 root       96    0  4632K  3172K select 1   0:00  0.00%  0.00% mc
81579 root        8    0  1356K  1176K wait   0   0:00  0.00%  0.00% =
bash
 9008 root        5    0  1332K  1152K ttyin  0   0:00  0.00%  0.00% =
bash
 5211 ramas      96    0  6220K  2956K select 0   0:00  0.00%  0.00% =
sshd
 9959 donatas    96    0  6220K  2956K RUN    0   0:00  0.00%  0.00% =
sshd
 5741 root        8    0  1632K  1312K wait   0   0:00  0.00%  0.00% =
login
 5209 root        4    0  6228K  2836K sbwait 0   0:00  0.00%  0.00% =
sshd
 9957 root        4    0  6228K  2836K sbwait 0   0:00  0.00%  0.00% =
sshd
 8562 root        4    0  6228K  2836K sbwait 1   0:00  0.00%  0.00% =
sshd
26422 root        4    0  6228K  2836K sbwait 0   0:00  0.00%  0.00% =
sshd
 8570 root        8    0  1352K  1172K wait   0   0:00  0.00%  0.00% =
bash
 9929 root        8    0  1356K  1176K wait   0   0:00  0.00%  0.00% =
bash
 9962 root        8    0  1388K  1208K wait   1   0:00  0.00%  0.00% =
bash
18236 root       96    0  2284K  1540K CPU0   0   0:00  0.00%  0.00% top
 5226 root        5    0  1356K  1176K ttyin  0   0:00  0.00%  0.00% =
bash
26426 maris       8    0  1636K  1300K wait   1   0:00  0.00%  0.00% su
 5225 ramas       8    0  1636K  1300K wait   0   0:00  0.00%  0.00% su
 8566 donatas     8    0  1636K  1300K wait   0   0:00  0.00%  0.00% su
 9961 donatas     8    0  1636K  1300K wait   0   0:00  0.00%  0.00% su
 9960 donatas     8    0  1328K  1148K wait   0   0:00  0.00%  0.00% =
bash
 8565 donatas     8    0  1328K  1148K wait   1   0:00  0.00%  0.00% =
bash
26425 maris       8    0  1328K  1148K wait   0   0:00  0.00%  0.00% =
bash
 5212 ramas       8    0  1328K  1148K wait   0   0:00  0.00%  0.00% =
bash
 8567 root        8    0  1388K  1208K wait   0   0:00  0.00%  0.00% =
bash
 5748 root        5    0  1276K   860K ttyin  0   0:00  0.00%  0.00% =
getty
 5746 root        5    0  1276K   860K ttyin  1   0:00  0.00%  0.00% =
getty
 5742 root        5    0  1276K   860K ttyin  1   0:00  0.00%  0.00% =
getty
 5747 root        5    0  1276K   860K ttyin  1   0:00  0.00%  0.00% =
getty
 5743 root        5    0  1276K   860K ttyin  1   0:00  0.00%  0.00% =
getty
 5744 root        5    0  1276K   860K ttyin  1   0:00  0.00%  0.00% =
getty
 5745 root        5    0  1276K   860K ttyin  1   0:00  0.00%  0.00% =
getty
20648 root      111    0  1396K   860K RUN    0   0:00  0.00%  0.00% =
grep
16650 root        8    0   916K   640K wait   0   0:00  0.00%  0.00% sh
16652 root       -8    0  1204K   636K pipdwt 0   0:00  0.00%  0.00% cat
_______________________________TOP ON =
4.10_____________________________________________________
last pid: 42087;  load averages:  0.36,  0.08,  0.03                     =
                                  up 79+23:40:33  09:02:26
45 processes:  4 running, 41 sleeping
CPU states: 24.3% user,  0.0% nice, 71.2% system,  4.5% interrupt,  0.0% =
idle (97% idle before loading the script)
Mem: 28M Active, 292M Inact, 84M Wired, 36K Cache, 60M Buf, 94M Free
Swap: 1008M Total, 1008M Free

  PID USERNAME PRI NICE  SIZE    RES STATE    TIME   WCPU    CPU COMMAND
31947 root      10   0   680K   472K wait     0:02 11.65%  4.93% sh
17018 root       2   0 14148K 13736K select 642:54  0.10%  0.10% ospfd
 1811 root       2   0  3788K  3040K select  75:25  0.00%  0.00% snmpd
24055 root      10 -20   684K   472K wait    37:40  0.00%  0.00% sh
   89 root       2   0  2596K  1960K select   1:25  0.00%  0.00% sshd
17014 root       2   0  2612K  2188K select   1:20  0.00%  0.00% zebra
   80 root       2   0   988K   716K select   0:16  0.00%  0.00% syslogd
   87 root      10   0  1028K   776K nanslp   0:13  0.00%  0.00% cron
17016 root       2   0  2028K  1608K select   0:10  0.00%  0.00% ripd
80454 maris      2   0  5296K  2316K select   0:00  0.00%  0.00% sshd
71392 root       2   0  4340K  2884K select   0:00  0.00%  0.00% mc
31859 root      28   0  1984K  1276K RUN      0:00  0.00%  0.00% top
31487 root       2   0  4144K  2736K select   0:00  0.00%  0.00% mc
16872 root       3   0  1800K  1536K ttyin    0:00  0.00%  0.00% bash
80518 root      10   0  1832K  1576K wait     0:00  0.00%  0.00% bash
71393 root       3   0  1828K  1584K ttyin    0:00  0.00%  0.00% bash
80452 root       2   0  5296K  2260K sbwait   0:00  0.00%  0.00% sshd
31577 root       2   0  5296K  2260K sbwait   0:00  0.00%  0.00% sshd
23959 root       2   0  5296K  2196K sbwait   0:00  0.00%  0.00% sshd
31447 root       2   0  5296K  2260K sbwait   0:00  0.00%  0.00% sshd
31449 donatas    2   0  5296K  2316K select   0:00  0.00%  0.00% sshd
 1814 root      10   0  1272K   984K wait     0:00  0.00%  0.00% login
31488 root      10   0  1812K  1568K wait     0:00  0.00%  0.00% bash
31452 root      10   0  1828K  1572K wait     0:00  0.00%  0.00% bash
31582 root      10   0  1828K  1572K wait     0:00  0.00%  0.00% bash
23988 root       3   0  1816K  1560K ttyin    0:00  0.00%  0.00% bash
31579 donatas   28   0  5296K  2320K RUN      0:00  0.00%  0.00% sshd
23961 ramas      2   0  5296K  2256K select   0:00  0.00%  0.00% sshd
80455 maris     10   0  1792K  1532K wait     0:00  0.00%  0.00% bash
31450 donatas   10   0  1792K  1532K wait     0:00  0.00%  0.00% bash
31580 donatas   10   0  1792K  1532K wait     0:00  0.00%  0.00% bash
23962 ramas     10   0  1772K  1512K wait     0:00  0.00%  0.00% bash
 1821 root       3   0   956K   660K ttyin    0:00  0.00%  0.00% getty
 1817 root       3   0   956K   660K ttyin    0:00  0.00%  0.00% getty
 1818 root       3   0   956K   660K ttyin    0:00  0.00%  0.00% getty
 1820 root       3   0   956K   660K ttyin    0:00  0.00%  0.00% getty
 1816 root       3   0   956K   660K ttyin    0:00  0.00%  0.00% getty
 1819 root       3   0   956K   660K ttyin    0:00  0.00%  0.00% getty
 1815 root       3   0   956K   660K ttyin    0:00  0.00%  0.00% getty
31944 root      10   0   636K   440K wait     0:00  0.00%  0.00% sh
31946 root      -6   0   224K   112K pipdwt   0:00  0.00%  0.00% cat
40692 root      10 -20   180K    64K nanslp   0:00  0.00%  0.00% sleep
   27 root      18   0   212K    88K pause    0:00  0.00%  0.00% =
adjkerntz
42086 root      43   0   680K   472K RUN      0:00  0.00%  0.00% sh
42087 root      43   0   680K   472K RUN      0:00  0.00%  0.00% sh
_________________________________________________________________________=
____________________
also testen on 4.8, 4.9 versions - results similar to 4.10 results.
_________________________________________________________________________=
____________________


      Donatas Gendvilas


      Duomen=F8 Perdavimo Departamentas

      Valdymo Centras

      Lithuania




      =20

 
------=_NextPart_000_00D8_01C4AC4E.D44673B0
Content-Type: application/octet-stream;
	name="script.sh"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="script.sh"

#! /bin/sh
#--------USER INFO EXTRACTING FROM THE =
DATABASE---------------------------------------------
clear
linija=3D"0"                              #line.nr
pass_total=3D"0"
fail_total=3D"0"
cat /home/donatas/user_project/database.dat | \
#-------DATABASE CONSISTS of the records like below
#Bravo Johnny White_St.50 PlesentWille	1225-23	2003-10-15

while read line
do
echo "Irasas =
Nr.$linija:--------------------------------------------------------------=
------"
pavarde=3D`echo $line |awk '{print $1}'`  #surename
vardas=3D`echo $line |awk '{print $2}'`   #name
adresas=3D`echo $line |awk '{print $3}'`	#address
miestas=3D`echo $line |awk '{print $4}'`  #town
regnr=3D`echo $line |awk '{print $5}'`    #reg.nr
regdt=3D`echo $line |awk '{print $6}'`    #reg.date
echo "pavarde=3D$pavarde vardas=3D$vardas  adresas=3D$adresas"
echo "miestas=3D$miestas regnr=3D$regnr    data=3D$regdt"
#----------SEARCHIN FOR USER FILE IN =
ROUTER--------------------------------------------------
passed=3D"0"
saved=3D"0"
for VAR in LIST; do
done
for ff in *; do
    pass=3D"0"
    stats=3D"000"
    if cat $ff |grep $pavarde > /dev/null; then
    echo "1.    Pavarde rasta faile $ff";
    pass=3D$(($pass+1))
    stats=3D"100"
    fi
   =20
    if cat $ff |grep $vardas > /dev/null; then
    echo "2.    Vardas rastas faile $ff";
        case $stats in
        000) stats=3D"010";;
        100) stats=3D"110";;
        esac
    fi
   =20
    if cat $ff |grep $adresas > /dev/null; then
    echo "3.    Adresas rastas faile $ff";
    pass=3D$(($pass+1))
        case $stats in
        000) stats=3D"001";;
        100) stats=3D"101";;
        110) stats=3D"111";;
        esac
    fi
   =20
    if cat $ff |grep $miestas > /dev/null; then
#    echo "4.   Miestas rastas faile $ff";
#    pass=3D$(($pass+1))
    fi

    if cat $ff |grep $regnr > /dev/null; then
#    echo "5.   Reg.Nr.  rastas faile $ff";
#    pass=3D$(($pass+1))
    fi
   =20
    if cat $ff |grep $regdt > /dev/null; then
#    echo "6.   Reg.data rasta faile $ff";
#    pass=3D$(($pass+1))
    fi

    case $pass in
    0) ;;
    *)
#       echo "                                                          =
pass_current=3D$pass"
        passed=3D$(($passed+1));;
    esac
#-------------------EDITTING FILE----------------------------------
keitimas()
{
        PREFIX=3D"`pwd`/$ff"
        if [ -r $PREFIX ]; then
        . /$PREFIX
#       adresas=3D`echo $adresas |tr "_" " "`
        else
        echo "path $PREFIX not found - sutvarkykite \"keitimas\" =
procedura"
        sleep 3
        exit 0;
        fi
        echo "# Billing information
USER_LIVING_ADDRESS=3D\"`echo $adresas |tr "_" " "`\"
USER_FULL_NAME=3D\"$pavarde $vardas\"
CONTRACT_ID=3D\"$regnr\"
REGISTRATION_DATE=3D\"$regdt\"

# Major parameters
NETWORK=3D\"$NETWORK\"

# Routed mode parameters
ROUTING=3D\"$ROUTING\"

# Bridged mode parameters
ROUTER_IP=3D\"$ROUTER_IP\"
USER_VLAN=3D\"$USER_VLAN\"

# Traffic parameters
NATIONAL_BW_OUT=3D\"$NATIONAL_BW_OUT\"
NATIONAL_BW_IN=3D\"$NATIONAL_BW_IN\"
INTERNATIONAL_BW_OUT=3D\"$INTERNATIONAL_BW_OUT\"
INTERNATIONAL_BW_IN=3D\"$INTERNATIONAL_BW_IN\"">$ff
}

    case $stats in
    100)
        echo "Found only SURENAME"
        keitimas
        ;;
    010) echo "Found only NAME"
    ;;   =20
    001)=20
        echo "Foun only ADDRESS"
        ;;
    110)=20
        echo "Found NAME and SURENAME"
        keitimas
        ;;
    111)=20
        echo "Found NAME SURENAME and ADDRESS"
        ;;
    *)
        ;;
    esac
#------------------------------------------------------------
done

    case $passed in
    0)=20
        fail_total=3D$(($fail_total+1));;
    *)
        pass_total=3D$(($pass_total+1));;
    esac
   =20
linija=3D$(($linija+1))

echo "                                                            =
pass_total=3D$pass_total"=20
echo "                                                            =
fail_total=3D$fail_total"
------=_NextPart_000_00D8_01C4AC4E.D44673B0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00dc01c4ac35$af0067a0$9f90a8c0>