Hello everyone,
I hope someone could shed some light on this.
We are running an IIS web server (on physical machine with dual P4 2.4 Ghz with HT and 2Gig RAM) that talks to Tamino (on another physical machine with single P4 2.4 Ghz with HT disabled and 2Gig RAM).
A web page will call a web service on the IIS that in turn will send off a query to Tamino via Software AG .NET API.
With a simple XQuery in the web service, if the web server is stress-load tested with just few simultaneous connections (2-5), Tamino’s inosrv.exe will consume 100% CPU time and it never goes down. Meanwhile, the web server machine is rolling at paltry 3% of CPU ressources.
I have talked to tech support, but they didn’t know what to do about it; they suggested Hyperthreading might be the issue, so I disabled it, but yet the performance didn’t increase.
So I made my own tests. When I stree-load tested Tamino with a url like so:
http://www.hahaha.com:3202/tamino/hahaha/main?_XQuery=for+$i+in+input()/generic-show+where+$i/@id+=+'nasty2004'+and+$i/@active=1+return+<show>+{$i/@id}+{+for+$venues+in+$i/venues+where+$venues/@active=1+return+<venues>+{+for+$venue+in+$venues/venue+let+$v+:=+input()/venue[@id=$venue/@id]+where+$venue/@active=1+return+($v)+}+</venues>+}+</show>
</pre><BR><BR>the results were very good; I could run at 100 simultaneous connections and the CPU would stay at 3-10%.<BR><BR>However, if I ran the same query, via a webservice (see code below), then the machine grinded to a halt at paltry 2-10 simultaneous connections.<BR><BR><BR><pre class="ip-ubbcode-code-pre">[WebMethod]
private System.Xml.XmlDocument GetQueryResult(string strXQuery)
{
SoftwareAG.Tamino.Api.TaminoConnection oCon = new SoftwareAG.Tamino.Api.TaminoConnection("http://www.hahaha.com:3202/tamino/hahaha");
oCon.Open(SoftwareAG.Tamino.Api.TaminoConnectionMode.AutoCommit);
SoftwareAG.Tamino.Api.TaminoCommand oCom = oCon.CreateCommand("main");
oCom.LockMode = SoftwareAG.Tamino.Api.TaminoLockMode.Shared;
SoftwareAG.Tamino.Api.TaminoQuery oQ = new SoftwareAG.Tamino.Api.TaminoQuery(strXQuery);
SoftwareAG.Tamino.Api.TaminoQueryResponse oQr = oCom.Query(oQ, 1);
System.Xml.XmlDocument xmlDoc = oQr.GetSinglePage();
oQr.Close();
oCon.Close();
return xmlDoc;
}</pre><BR><BR>where the XQuery passed into that web service is as follows:<BR><BR><pre class="ip-ubbcode-code-pre">strXQuery = @"for $i in input()/generic-show
where $i/@id = 'nasty2004' and $i/@active=1
return
<show>
{$i/@id}
{
for $venues in $i/venues
where $venues/@active=1
return
<venues>
{
for $venue in $venues/venue
let $v := input()/venue[@id=$venue/@id]
where $venue/@active=1
return ($v)
}
</venues>
}
</show>";
Note: I have tried to change the parameters for the connection.Open method, playing with the Lock mode and LockWait and IsolationLevel etc, but it didn’t seem to help at all no matter the combination.
I now have some additional questions:
1). It may very well be that it’s the opening and closing of the connection per request that slows things down. Personally I think that if that is so, it’s extremely inneficient (remember, that even 2 simultaneous requests will bring the server to a halt).
I was wondering if putting the connection perhaps into ASP.NET’s Cache would improve things. The first request opens the connection, puts it into Cache and subsequent requests will use the already opened connection.
2) If I were to put the connection into the cache - I don’t like the solution too much, but for now it may be the workaround - there could be other problems involved with this. How would I know if eventually the connection got disconnected by Tamino? The connection object would still be alive, but the connection itself to Tamino might be closed. Also, how safe is it to use the same connection for many requests? Obviously in some scenarios I would need to open the connection more frequently, perhaps when using transactions.
3) Maybe I could put the connection object into the session. But even then, if I get too many unique visitors, I would still have a very bad performance.
4) Can someone tell me where to find more info on the different values for each parameter in connection.Open method? I mean I haven’t got a clue what the diff is between, for example, TaminoIsolationLevel.StableDocument and TaminoIsolationLevel.CommittedCommand or TaminoLockMode.Shared and TaminoLockMode.Unprotected, to name but a few.
I read all the docs for the .NET API and couldn’t find this info anywhere!
Thank you very much for helping me with this issue.
Peter Endisch
---------------------------------------
I’m a Zen Garden Maintenance Engineer
---------------------------------------
#webMethods#API-Management#webMethods-Tamino-XML-Server-APIs