J
John Doe
I have written a web service that returns an XmlDocument. The code is similar
to the example below, except it returns an XmlDocument rather than an
XmlDataDocument. When I run the service from the test harness in VS (or from
a client page), CPU utilization on the Web server spikes to over 50% and
returns quickly to around 0-5% after it has completed. I have tried the
following:
1) Changed the type returned by the web service to type string.
2) Turned off Session State on the web server
3) Turned off logging on the Web server
4) Use anonymous authentication.
I would like to limit the amount of processor used on the web server when
the service is called. My client is concerned about this, because eventually
there will be hundreds of concurrent users. What other steps can I take to
limit the amount of CPU used?
[WebMethod( Description="Returns Northwind Customers",EnableSession =false)]
public XmlDocument GetData()
{
SqlConnection conn = new SqlConnection("Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=Northwind;Data Source=xxxxxxx");
SqlDataAdapter cmd = new SqlDataAdapter("Select * from Customers",conn);
DataSet ds = new DataSet();
cmd.Fill(ds,"Orders");
XmlDataDocument doc = new XmlDataDocument(ds);
return doc;
to the example below, except it returns an XmlDocument rather than an
XmlDataDocument. When I run the service from the test harness in VS (or from
a client page), CPU utilization on the Web server spikes to over 50% and
returns quickly to around 0-5% after it has completed. I have tried the
following:
1) Changed the type returned by the web service to type string.
2) Turned off Session State on the web server
3) Turned off logging on the Web server
4) Use anonymous authentication.
I would like to limit the amount of processor used on the web server when
the service is called. My client is concerned about this, because eventually
there will be hundreds of concurrent users. What other steps can I take to
limit the amount of CPU used?
[WebMethod( Description="Returns Northwind Customers",EnableSession =false)]
public XmlDocument GetData()
{
SqlConnection conn = new SqlConnection("Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=Northwind;Data Source=xxxxxxx");
SqlDataAdapter cmd = new SqlDataAdapter("Select * from Customers",conn);
DataSet ds = new DataSet();
cmd.Fill(ds,"Orders");
XmlDataDocument doc = new XmlDataDocument(ds);
return doc;