Showing posts with label pages. Show all posts
Showing posts with label pages. Show all posts

Saturday, February 25, 2012

CPU 100%

Hi,

I have sql server on a web server.
The machine grinds almost to a halt at peak times, as the asp pages are
causing sql server to use most of the cpu.
Looking at the graph it is at 100% for about 20 seconds at a time, then
drops, then goes back up.

Is there anything I can do to make sql server use less of the cpu? (Without
causing the asp pages to hand.)

Thanks

JJJJ (nospam) writes:
> I have sql server on a web server.
> The machine grinds almost to a halt at peak times, as the asp pages are
> causing sql server to use most of the cpu.
> Looking at the graph it is at 100% for about 20 seconds at a time, then
> drops, then goes back up.
> Is there anything I can do to make sql server use less of the cpu?

Probably. But exactly what I cannot tell. I can however give some
suggestions of what you can do to track down the problem. The best
approach is to use the Profiler. With this tool you can track commands
send to SQL Server, and you can get information about them. Assuming
that the source of the problem is a resource-intensive query, you
can use the Profiler to narrow down which query/ies it may be. Once
you have located one or more queries, you can look into how to improve
them, for instance by adding indexes.

Depending on your budget, you may also consider putting SQL Server on a
separate box, so that the web server and SQL Server does not have to
compete for resources.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Hi,
Many Thanks for the reply.
I am on the verge of investing in a new server anyway, as it seems easier to
throw more hardware at it, although I appreciate this is not necessarily the
best solution.
However, if I can get sql server on a separate box, hopefully my problems
will be solved!

JJ
"Erland Sommarskog" <sommar@.algonet.se> wrote in message
news:Xns94ECF2D31D7D6Yazorman@.127.0.0.1...
> JJ (nospam) writes:
> > I have sql server on a web server.
> > The machine grinds almost to a halt at peak times, as the asp pages are
> > causing sql server to use most of the cpu.
> > Looking at the graph it is at 100% for about 20 seconds at a time, then
> > drops, then goes back up.
> > Is there anything I can do to make sql server use less of the cpu?
> Probably. But exactly what I cannot tell. I can however give some
> suggestions of what you can do to track down the problem. The best
> approach is to use the Profiler. With this tool you can track commands
> send to SQL Server, and you can get information about them. Assuming
> that the source of the problem is a resource-intensive query, you
> can use the Profiler to narrow down which query/ies it may be. Once
> you have located one or more queries, you can look into how to improve
> them, for instance by adding indexes.
> Depending on your budget, you may also consider putting SQL Server on a
> separate box, so that the web server and SQL Server does not have to
> compete for resources.
>
> --
> Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||JJ (nospam) writes:
> I am on the verge of investing in a new server anyway, as it seems
> easier to throw more hardware at it, although I appreciate this is not
> necessarily the best solution.

Hey, if a new server costs 30000 crowns (a modest and cheap one), and
a consultant costs 1000 crowns an hour, and it takes him 40 hours to
track down the problem and fix it, throwing hardware on it may even
be a better solution.

Although judging from your description it sounds like you will still
have performance problems even with a new box, but hopefully less
severe - and maybe you can live with them.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 17, 2012

counting pages etc

i'm trying to make certian stuff inside a table header be shown on the
first page ONLY ,and other stuff hidden on the first page..
I'm having a lot of problems
in the end i want to put hidden.visibility to be based on some logic,
but i've found no way to differentiate the pages..
for example i try this custom code, to test something out, figure that
i should get a incremental increase everytime it is called
public shared thecount as integer = 0
Public Function docount as Integer
thecount = thecount + 1
return thecount
End Function
but inside the tables header i have
=Code.docount
and it shows 0 on every page..
anybody else pulled their hair out on this one, and has come through
the other side?I have an example of putting items in the footer on the first page only at
www.MSBICentral.com
It does not try to count pages, but can tell if this is the first
page...The File is called PageFooterOnFirstOnly.RDL
It is in the downloads section... Hope this helps..
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Karl Prosser" <klumsy@.xtra.co.nz> wrote in message
news:7156880c.0502151713.2432cd30@.posting.google.com...
> i'm trying to make certian stuff inside a table header be shown on the
> first page ONLY ,and other stuff hidden on the first page..
> I'm having a lot of problems
> in the end i want to put hidden.visibility to be based on some logic,
> but i've found no way to differentiate the pages..
> for example i try this custom code, to test something out, figure that
> i should get a incremental increase everytime it is called
> public shared thecount as integer = 0
> Public Function docount as Integer
> thecount = thecount + 1
> return thecount
> End Function
> but inside the tables header i have
> =Code.docount
> and it shows 0 on every page..
> anybody else pulled their hair out on this one, and has come through
> the other side?|||thanks for the example, but making a footer only show on the first page
was not my problem since headers and footers can look at the global
page counter, it was something in the body, in the header of a table..
i could use repeatonnewpage, however i needed some header stuff to show
sometimes and some not to. and i found that that even though a table
header can have many rows and each row has a repeat on new page
property, if you change one row, it changes them all, anyhow i managed
to do it with created another group, a dummy group and having my logic
in there..
also i found out why my example code above didn't work, it seems RS
only calculates the table header once (even though it repeats it on
subsequent pages, it doesn't recalculaste it, just reuses whatever was
last calculated)
Karl
Wayne Snyder wrote:
> I have an example of putting items in the footer on the first page
only at
> www.MSBICentral.com
> It does not try to count pages, but can tell if this is the first
> page...The File is called PageFooterOnFirstOnly.RDL
> It is in the downloads section... Hope this helps..
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Karl Prosser" <klumsy@.xtra.co.nz> wrote in message
> news:7156880c.0502151713.2432cd30@.posting.google.com...
> > i'm trying to make certian stuff inside a table header be shown on
the
> > first page ONLY ,and other stuff hidden on the first page..
> > I'm having a lot of problems
> > in the end i want to put hidden.visibility to be based on some
logic,
> > but i've found no way to differentiate the pages..
> >
> > for example i try this custom code, to test something out, figure
that
> > i should get a incremental increase everytime it is called
> >
> > public shared thecount as integer = 0
> > Public Function docount as Integer
> > thecount = thecount + 1
> > return thecount
> > End Function
> >
> > but inside the tables header i have
> > =Code.docount
> >
> > and it shows 0 on every page..
> >
> > anybody else pulled their hair out on this one, and has come
through
> > the other side?