Performance Advice

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an aspx page one of the page functions is retrieve a student marks as
following procedure

1. Open sql server database connection
2. add the required parameters for the stored procedure
3. execute the command

as this page expect to server more than 10000 users if half of them are
working at same time the procedures up will be executed 5000 times . are
there methods to reduce number of times for openning database connection?

hope i explained my problem well
 
¤ I have an aspx page one of the page functions is retrieve a student marks as
¤ following procedure
¤
¤ 1. Open sql server database connection
¤ 2. add the required parameters for the stored procedure
¤ 3. execute the command
¤
¤ as this page expect to server more than 10000 users if half of them are
¤ working at same time the procedures up will be executed 5000 times . are
¤ there methods to reduce number of times for openning database connection?
¤
¤ hope i explained my problem well

Since this is a web application, connection pooling, which is enabled by default, will reduce the
number of times new database connections are actually created.

In addition, for a web page, the connection will only be required for the duration of the post to
the web server.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
The better way to do would be.

1. Create Connection (don't open it)
2. Create Command
3. Add parameters
4. Open Connection
5. ExecuteCommand
6. Close Connection
7. Work on the results of command execution.

- Sahil Malik [MVP]
Upcoming ADO.NET 2.0 book - http://tinyurl.com/9bync
 
You have already been given great advice. However, to maximize performance,
you need to focus on the question being asked, not how fast you ask it. In
other words, focus on the performance of the SP--not necessarily on the
client executing the query. Use the Query Analyzer to see if the SP is being
executed efficiently. Are the right indexes in place? Are you returning too
many rows? Do the SP parameters match the query plan--each time the SP is
executed? Are you sorting on the server where a client-side sort would be
faster?

Yes, you should open the connection "just in time" and close it
immediately--unless you're using a Fill (which handles connections for you).
If you're using a DataReader, are you turning around and converting the data
stream into a DataTable to gain the filter/sort features? If so, consider
using the Fill method instead--it will save you time in an overall sense.

I'll be discussing all of these issues in my workshop on June 18th in
Montreal (DevTeach).

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
www.sqlreportingservices.net
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top