[ug-bosug] CPU Usage

Binu Jose Philip binujp at gmail.com
Wed Dec 12 08:36:48 PST 2007


On Dec 12, 2007 7:19 AM,  <murageshgouda.patil at wipro.com> wrote:
>
> Hi Binu,
>
> Thank You very much for your advice. It was very helpful.
>
> I have one more query regarding CPU Usage of a process. We have a C++
> threaded process running on Solaris 10.The maximum number of threads
> this process can spawn is 12. It is a parser process; it converts an xml
> file into bcp format. We are monitoring the CPU usage of this process
> using prstat.
>
> What we observe is when ever there are files to be parsed the CPU usage
> shoots up gradually to 28% for this process and then reduces slowly and
> comes to 0% after all the files are parsed. Please note the system is a
> 23CPU system.
>
> Is this an expected behavior?

The workload is a mix of i/o bound reading and writing files, and cpu bound,
format conversion jobs. CPU usage will gradually climb to a peak by when
all threads have loaded their files, stay up there and then fall off.

> Can we code in such a way that the CPU Usage can be kept under control?

It is difficult to control CPU usage in code. You can use projects or zones with
SRM or the Fair Share Scheduler to control or limit CPU usage. The easiest way
given you have a lot of CPUs is to use processor sets or processor bindings.

All these features are available in S10.

If you are on opensolaris/nevada, CPU caps is yet another option.

cheers
Binu

> --
> Thanks And Regards
> Murageshgouda M Patil
> +91-80-28411990 Extn.1343
>
>
> -----Original Message-----
> From: Binu Jose Philip [mailto:binujp at gmail.com]
> Sent: Wednesday, December 12, 2007 2:18 AM
> To: Murageshgouda M Patil (WT01 - Telecom Applications and Solutions)
> Subject: Re: [ug-bosug] Write system call uses /var/tmp/ directory.
>
> On Dec 11, 2007 6:19 AM,  <murageshgouda.patil at wipro.com> wrote:
> >
> > Hi All,
> >
> > I putting forward simple question, As I am newbie to this Solaris.
> > I have searched browsed through lot of sites, I didn't get the answer.
> > It's the basic question; Solaris uses /var/tmp/ directory within write
> > system call for storing temporary data.
>
> What temporary data is write() system call storing? I am not aware of
> write having to store temporary data in /var/tmp. Could you explain what
> are doing and what you are seeing?
>
> > It might have used /tmp/ directory instead. As of my knowledge I think
> both
> > are used for temporary storage.
> >
> > What the basic idea of having "/var/tmp/" directory?
>
> var stands for 'variable'. Traditionally all logs, caches, temporary
> files,
> process run  information, anything that needs updating or appending,
> would be under here. The tmp directory is for persistent temporary data.
>
> Not many directories other than /var/tmp that are world writeable and
> owned by root.
>
> > And what is the difference between /var/tmp and /tmp directory?
>
> /var/tmp is a disk file system, data you wite there is persistant. /tmp
> is the equivalent of a ramdisk. If you write to /tmp, you are writing to
> memory. It is not persistant. You will loose /tmp contents on reboot.
>
> /tmp is much faster than /var/tmp. But using /tmp will use up your
> available memory.
>
> cheers
> Binu
>
> >
> >
> >
> >
> >
> > --
> >
> > Thanks And Regards
> >
> > Murageshgouda M Patil
> >
> > +91-80-28411990 Extn.1343
> >
> >
> >
> >  The information contained in this electronic message and any
> attachments to
> > this message are intended for the exclusive use of the addressee(s)
> and may
> > contain proprietary, confidential or privileged information. If you
> are not
> > the intended recipient, you should not disseminate, distribute or copy
> this
> > e-mail. Please notify the sender immediately and destroy all copies of
> this
> > message and any attachments.
> >
> >  WARNING: Computer viruses can be transmitted via email. The recipient
> > should check this email and any attachments for the presence of
> viruses. The
> > company accepts no liability for any damage caused by any virus
> transmitted
> > by this email.
> >
> >  www.wipro.com
> >
> > _______________________________________________
> > ug-bosug mailing list
> > List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
> > List-Owner: mailto:ug-bosug-owner at opensolaris.org
> > List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumID=54
> >
>
>  The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.   WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.   www.wipro.com
>


More information about the ug-bosug mailing list