U
usenetaccount
In a newly created test app, to maximize client performance I tried to
make two SOAP method calls in tandem (the soap methods execute some
specified query), as each call includes a large amount of idle time by
the client as it waits for a query to execute and return a dataset.
As a test, I initially wrote two versions:
' // Sequential & Synchronous
Dim webobj As com.mycompany.webobject
Dim ds1 As System.Data.DataSet
Dim ds2 As System.Data.DataSet
webobj = new com.mycompany.webobject
ds1 = webobj.Test("qry_1")
ds2 = webobj.Test("qry_2")
MsgBox "Done!"
' // Asynchronous
Dim webobj As com.mycompany.webobject
Dim arQry1 As IAsyncResult
Dim arQry2 As IAsyncResult
Dim ds1 As System.Data.DataSet
Dim ds2 As System.Data.DataSet
webobj = new com.mycompany.webobject
arQry1 = webobj.BeginTest("qry_1", Nothing, Nothing)
arQry2 = webobj.BeginTest("qry_2", Nothing, Nothing)
ds1 = webobj.EndTest(arQry1)
ds2 = webobj.EndTest(arQry1)
MsgBox "Done!"
.....
Query 1 returns about 18,000 rows while Query 2 returned about 200.
The surprising result was that the asynchronous way took about 30
seconds while the synchronous way took about 13.
As a reality check, I then changed Query 2 to a longer running query
which returned about 10,000 rows. I also created a third,
multi-threaded version of the test. Each thread calls the SYNCHRONOUS
SOAP method and for the most part, it should be approximately the same
as the asynchronous version.
As expected, the multi-threaded version outperforms the sequential
version. But even with TWO long-running queries, the asynchronous
version STILL underperforms the sequential version!
Someone suggested updating the file machine.config with
maxconnections="10" (from "2") but this had no effect in my cas.
Any ideas as to what's going on? I have no problems creating a
multi-threaded application if that's what it takes, but for
maintainability I'd rather keep the code as simple as possible if I
can.
Thanks!
make two SOAP method calls in tandem (the soap methods execute some
specified query), as each call includes a large amount of idle time by
the client as it waits for a query to execute and return a dataset.
As a test, I initially wrote two versions:
' // Sequential & Synchronous
Dim webobj As com.mycompany.webobject
Dim ds1 As System.Data.DataSet
Dim ds2 As System.Data.DataSet
webobj = new com.mycompany.webobject
ds1 = webobj.Test("qry_1")
ds2 = webobj.Test("qry_2")
MsgBox "Done!"
' // Asynchronous
Dim webobj As com.mycompany.webobject
Dim arQry1 As IAsyncResult
Dim arQry2 As IAsyncResult
Dim ds1 As System.Data.DataSet
Dim ds2 As System.Data.DataSet
webobj = new com.mycompany.webobject
arQry1 = webobj.BeginTest("qry_1", Nothing, Nothing)
arQry2 = webobj.BeginTest("qry_2", Nothing, Nothing)
ds1 = webobj.EndTest(arQry1)
ds2 = webobj.EndTest(arQry1)
MsgBox "Done!"
.....
Query 1 returns about 18,000 rows while Query 2 returned about 200.
The surprising result was that the asynchronous way took about 30
seconds while the synchronous way took about 13.
As a reality check, I then changed Query 2 to a longer running query
which returned about 10,000 rows. I also created a third,
multi-threaded version of the test. Each thread calls the SYNCHRONOUS
SOAP method and for the most part, it should be approximately the same
as the asynchronous version.
As expected, the multi-threaded version outperforms the sequential
version. But even with TWO long-running queries, the asynchronous
version STILL underperforms the sequential version!
Someone suggested updating the file machine.config with
maxconnections="10" (from "2") but this had no effect in my cas.
Any ideas as to what's going on? I have no problems creating a
multi-threaded application if that's what it takes, but for
maintainability I'd rather keep the code as simple as possible if I
can.
Thanks!