PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > I don't understand why the following increases cpu time
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

I don't understand why the following increases cpu time

Réponse
 
LinkBack Outils de la discussion
Vieux 09/01/2008, 02h31   #1
grocery_stocker
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut I don't understand why the following increases cpu time

If I do the following...

% cat < /dev/zero

And look at top, nothing shows ups.....

last pid: 83551; load averages: 1.82, 1.64, 1.38 up
49+10:45:28 21:26:16
217 processes: 2 running, 182 sleeping, 1 stopped, 32 zombie

Mem: 139M Active, 632M Inact, 164M Wired, 33M Cache, 111M Buf, 28M
Free
Swap: 512M Total, 512M Free


PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU
COMMAND
279 buttemb 1 129 5 3212K 1808K RUN 241.8H 17.29% bash
82205 vrana 1 5 5 7228K 5168K ttyin 0:00 2.45% lynx
50756 serapis 1 5 5 8380K 6320K ttyin 0:02 1.90% lynx



However, if I change it so /dev/zero goes to /dev/nulll

m-net% cat < /dev/zero > /dev/null


And then look at top, I see that I'm taking up 52.08% CPU time...

last pid: 48206; load averages: 1.44, 1.24, 1.20 up
49+10:41:45 21:22:33
215 processes: 4 running, 179 sleeping, 1 stopped, 31 zombie

Mem: 136M Active, 632M Inact, 164M Wired, 33M Cache, 111M Buf, 31M
Free
Swap: 512M Total, 512M Free


PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU
COMMAND
47506 cdalten 1 127 5 1272K 652K RUN 0:05 52.08% cat
279 buttemb 1 128 5 3212K 1808K RUN 241.8H 16.11% bash
43171 vrana 1 5 5 7844K 5832K ttyin 0:02 5.75% lynx



The question why does copying to /dev/null make a sharp increas in CPU
time.
  Réponse avec citation
Vieux 09/01/2008, 06h04   #2
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: I don't understand why the following increases cpu time

In article
<1f8cf61d-933a-4171-9912-fcb9b8a1ff27@q39g2000hsf.googlegroups.com>,
grocery_stocker <cdalten@gmail.com> wrote:

> If I do the following...
>
> % cat < /dev/zero
>
> And look at top, nothing shows ups.....
>
> last pid: 83551; load averages: 1.82, 1.64, 1.38 up
> 49+10:45:28 21:26:16
> 217 processes: 2 running, 182 sleeping, 1 stopped, 32 zombie
>
> Mem: 139M Active, 632M Inact, 164M Wired, 33M Cache, 111M Buf, 28M
> Free
> Swap: 512M Total, 512M Free
>
>
> PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU
> COMMAND
> 279 buttemb 1 129 5 3212K 1808K RUN 241.8H 17.29% bash
> 82205 vrana 1 5 5 7228K 5168K ttyin 0:00 2.45% lynx
> 50756 serapis 1 5 5 8380K 6320K ttyin 0:02 1.90% lynx


When you write to the terminal, the speed of the terminal throttles how
quickly cat can run.

> However, if I change it so /dev/zero goes to /dev/nulll
>
> m-net% cat < /dev/zero > /dev/null
>
>
> And then look at top, I see that I'm taking up 52.08% CPU time...
>
> last pid: 48206; load averages: 1.44, 1.24, 1.20 up
> 49+10:41:45 21:22:33
> 215 processes: 4 running, 179 sleeping, 1 stopped, 31 zombie
>
> Mem: 136M Active, 632M Inact, 164M Wired, 33M Cache, 111M Buf, 31M
> Free
> Swap: 512M Total, 512M Free
>
>
> PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU
> COMMAND
> 47506 cdalten 1 127 5 1272K 652K RUN 0:05 52.08% cat
> 279 buttemb 1 128 5 3212K 1808K RUN 241.8H 16.11% bash
> 43171 vrana 1 5 5 7844K 5832K ttyin 0:02 5.75% lynx


The /dev/null driver is very efficient, since it doesn't have to do
anything. This allows cat to run at full speed and use more CPU time.

> The question why does copying to /dev/null make a sharp increas in CPU
> time.


--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09856 seconds with 10 queries