[Iftop-users] RE: the CPU usage is 100% when shell or perl script run iftop

Darren (Chenji) Xu dxu at good.com
Thu, 13 Feb 2014 04:41:38 +0000


--_000_7AA26F04C7BEC544A7A44C689A8308041C61D358EXSC5MBX01corpg_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

When I remove the pthread usage,it's ok.

From: iftop-users-admin@lists.beasts.org [mailto:iftop-users-admin@lists.be=
asts.org] On Behalf Of Darren (Chenji) Xu
Sent: Wednesday, February 12, 2014 4:04 PM
To: iftop-users@lists.beasts.org
Subject: [Iftop-users] RE: the CPU usage is 100% when shell or perl script =
run iftop

I find the root cause: shouldn't use & after "iftop -nt",because "&"  tells=
 bash to fork again.After I test,it's OK.

From: iftop-users-admin@lists.beasts.org<mailto:iftop-users-admin@lists.bea=
sts.org> [mailto:iftop-users-admin@lists.beasts.org] On Behalf Of Darren (C=
henji) Xu
Sent: Wednesday, February 12, 2014 2:17 PM
To: iftop-users@lists.beasts.org<mailto:iftop-users@lists.beasts.org>
Subject: [Iftop-users] the CPU usage is 100% when shell or perl script run =
iftop

Hi Paul,

Do you encounter this issue? I haven't found this issue when I used tcpdump=
.
I think it maybe a iftop bug.

Thanks,
Darren
-------
PS:
#!/bin/bash
#tcpdump -nnlqp tcp &
iftop -nt &

--_000_7AA26F04C7BEC544A7A44C689A8308041C61D358EXSC5MBX01corpg_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"\@SimSun";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.EmailStyle18
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.EmailStyle19
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
span.EmailStyle22
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">When I remove the pthr=
ead usage,it&#8217;s ok.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<div>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:&quot=
;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style=3D"font-s=
ize:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> iftop-us=
ers-admin@lists.beasts.org [mailto:iftop-users-admin@lists.beasts.org]
<b>On Behalf Of </b>Darren (Chenji) Xu<br>
<b>Sent:</b> Wednesday, February 12, 2014 4:04 PM<br>
<b>To:</b> iftop-users@lists.beasts.org<br>
<b>Subject:</b> [Iftop-users] RE: the CPU usage is 100% when shell or perl =
script run iftop<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">I find the root cause:=
 shouldn&#8217;t use &amp; after &#8220;iftop -nt&#8221;,because &#8220;&am=
p;&#8221; &nbsp;tells bash to fork again.After I test,it&#8217;s OK.<o:p></=
o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<div>
<div style=3D"border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt;font-family:&quot=
;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style=3D"font-s=
ize:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
<a href=3D"mailto:iftop-users-admin@lists.beasts.org">iftop-users-admin@lis=
ts.beasts.org</a> [<a href=3D"mailto:iftop-users-admin@lists.beasts.org">ma=
ilto:iftop-users-admin@lists.beasts.org</a>]
<b>On Behalf Of </b>Darren (Chenji) Xu<br>
<b>Sent:</b> Wednesday, February 12, 2014 2:17 PM<br>
<b>To:</b> <a href=3D"mailto:iftop-users@lists.beasts.org">iftop-users@list=
s.beasts.org</a><br>
<b>Subject:</b> [Iftop-users] the CPU usage is 100% when shell or perl scri=
pt run iftop<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Hi Paul,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Do you encounter this issue? I haven&#8217;t found t=
his issue when I used tcpdump.<o:p></o:p></p>
<p class=3D"MsoNormal">I think it maybe a iftop bug.<o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Thanks,<o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Darren<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">-------<o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal">PS:<o:p></o:p></p>
<p class=3D"MsoNormal">#!/bin/bash<o:p></o:p></p>
<p class=3D"MsoNormal">#tcpdump -nnlqp tcp &amp;<o:p></o:p></p>
<p class=3D"MsoNormal">iftop -nt &amp;<o:p></o:p></p>
</div>
</body>
</html>

--_000_7AA26F04C7BEC544A7A44C689A8308041C61D358EXSC5MBX01corpg_--