Showing posts with label requests. Show all posts
Showing posts with label requests. Show all posts

Monday, March 12, 2012

Im flooding my SQL Server with INSERT / UPDATE requests. How do I optimize?

I have an application that calculates a bunch of numbers and then inserts them into a table (or updates a record in the table if it exists). In my test environment it is issuing 100 insert or update requests to the server per second and it could run for several hours.
After a the first several hundred requests, the SQL server is bogging down (processor at 90-100%) and the application slows down while it waits on SQL to update the database.
What would be the best way to optimize this app? Would it help to loop through all my insert/update requests and then send them as one big batch of statements to the server (per 1000 requests or something)? Is there a better way of doing this?
Thanks!

Here are two approachs we did:

1. Queue up all insert/update, and run batch job as one transaction in one connection, next release of our Lattice.DataMapper will support run batch job in a seperate thread at certain time you define, see midnight tonight.
2. You can send a xml doc with all your insert/update data over to SQL server and call stored procedures using SQL server xml support. So only one stored procedure call you are done.

Friday, March 9, 2012

IIS Virtual Directory Manager and IIS 6: Template requests not being actioned.

Hi,
I have XML Data Islands on my page that are correctly requesting data
from the Virtual Directory. I can see the requests in the IIS log.
However the virtual directory doesn't seem to be returning anything -
no error message no nothing. When I run the same query from IE6
directly it runs fine.
I have run a trace on the database and nothing is being requested.
How can I debug this - is there an error log somewhere that I could
look at? What am I missing?
Info: SQL Server 2000 SP4 is on a separate database. I am using
Integrated Windows Authentication and delegation.
Cheers,
JamesSorry, this was specific to our setup... ignore.
JimLad wrote:

> Hi,
> I have XML Data Islands on my page that are correctly requesting data
> from the Virtual Directory. I can see the requests in the IIS log.
> However the virtual directory doesn't seem to be returning anything -
> no error message no nothing. When I run the same query from IE6
> directly it runs fine.
> I have run a trace on the database and nothing is being requested.
> How can I debug this - is there an error log somewhere that I could
> look at? What am I missing?
> Info: SQL Server 2000 SP4 is on a separate database. I am using
> Integrated Windows Authentication and delegation.
> Cheers,
> James