> Yes, that's what I thought, that it would go ahead and use whatever it
> needed to and that wasn't a bad thing. I'm just so new at this that I
> wanted to make sure I was on the right track. But I'm fine with it using
> 100% of CPU. I just wasn't sure if that was a bad thing.
> 
> I actually just ran the same program twice at the same time from two
> windows. The only affect that seemed to have is that the second one took
> 24 seconds to finish instead of the usual 12. So I would think If I have
> two processes that would both consume 100% CPU time and everything ran ok
> then I should be ok. 
> 
> One question about using nice. Right now I've tried including it in my
> Perl script like this:
> 
> #!/bin/nice  /usr/local/bin/perl
> 
> I don't get any errors and everything runs ok. My understanding is that
> this defaults to a 10. Is this right way to do it?
> 
> John 
> 
> -----Original Message-----
> From: Peter Cornelius [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, May 14, 2001 10:29 AM
> To:   'John Peterson'
> Subject:      RE: Perl, Nice, and CPU Usage
> 
> Another comment on this is, why would it be a problem to use 100% of the
> CPU?  If nothing else is trying to run then Don't you want it to use as
> much
> processor as it needs?  I would try running several tasks at once and see
> how they balance out.  Also, as Brett mentioned, you can 'nice' the
> process
> from the command line to make sure it takes an appropriate priority over
> (or
> under) other tasks running at the time.
> 
> "just 2 cents"
> Peter C.
> 
> -----Original Message-----
> From: John Peterson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 14, 2001 8:30 AM
> To: '[EMAIL PROTECTED]'
> Subject: Perl, Nice, and CPU Usage
> 
> 
> > Hi: 
> > 
> > I'm working on Sun Solaris and I've written a Perl program that uses DBI
> > to access two Informix databases to generate a report. There are
> > approximately 150,000 records it must proccess to generate the report.
> > Everything seems to work perfectly and the program runs for
> approximately
> > 12 seconds and generates the appropriate results.
> > 
> > If I do an IOSTAT command from another window while running the Perl
> > program, I see that Idle CPU time drops down to 0%. This is on a test
> box
> > and I'm usually the only one on it, so Idle CPU time prior to running is
> > at 100%. The CPU idle time drops to 0% for approximately 12 seconds,
> while
> > the report is running.
> > 
> > My question: Is this normal? If I use a Nice command in my Perl program
> > and set my priority at a higher number will this be ok to run on a
> > production server? I don't know much about this stuff yet but my
> reasoning
> > says, "of course it would use 100% of the resources to get the job done
> if
> > that's what it takes. As long as it lets other processes go in front of
> > it, everything should be ok". Is my reasoning correct?
> > 
> > John Peterson
> > Gentner Communications Corporation
> > 801.974.3693
> > [EMAIL PROTECTED]
> > "Perfect Communication through Technology, Service and Education."
> > 
> > 

Reply via email to