First of all thanks Wiggins and Alex,

For some reasons, I don't want to post the script.

Long story short, I was reading a big file using While statement that was
overloading the server. I used grep to solve this issue.

I am intent to make more changes within the script and would like to know
CPU usage/load on each step of modifying it.

Further, I think, the newbies like us should know CPU usage/load for their
developed scripts as it will help us to program better.

Okay, now again, I am on shared hosting of Ipowerweb.com. Do I have access
to /proc? Nope.

Any further help?

Any CPAN module for it? I tried to search but failed to find.

Once again thanks for your help.

Sara.



----- Original Message -----
From: "Wiggins d Anconia" <[EMAIL PROTECTED]>
To: "Alexander Blüm" <[EMAIL PROTECTED]>; "Sara" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, July 14, 2004 6:41 PM
Subject: Re: CPU load/server resources.


> > On Tue, 13 Jul 2004 15:30:36 -0600
> > "Wiggins d Anconia" <[EMAIL PROTECTED]> wrote:
> >
> > > >
> > > > I had a script for which my previous host cancelled my account
> > > > saying
> > > it's a resource hog and using more than 50% resources of the server
> > > (shared hosting).
> > > >
> > > > Yep, there were some faults in the script. I modified it and they
> > > restored the account.
> > > >
> > > > But now I am looking for some script/subroutine within the script
> > > > that
> > > can give me the CPU/resource usage when the script runs?
> > > >
> > > > I have NO idea about it.
> > > >
> > > > Can anyone help me with it?
> > >
> > > This tends to be a very system dependent thing.   I find it odd that
> > > you would need to run a script in such an environment, isn't that what
> > > the hoster does?  Or are you talking about the resource usage of the
> > > script specifically?
> > >
> > > In any case, give us more information about your platform.  If it is
> > > Unix can you read from /proc?
> >
> > yes, use:
> >
> > **********************
> > open (F, "</proc/$$/stat") || die "error opening /proc/$$/stat: $!\n"
> > # $$ is current PID
> > @content = split /\s+/, <F>;
> > close F;
> > print join("\n",@content), "\n";
> > **********************
>
> That's going to be pretty ineffective on Windows I suspect, or on a
> system either without /proc or where /proc has not been mounted.
>
> >
> > all YOU need to find out now is what what each element means... and
> > share your wisdom with us. well, I'd like to know. ;)
> >
>
> man proc
>
> http://danconia.org
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to