Hi i use UniDAC 8.1.2 for SQL Server 11 with mORMot's SynDBUniDAC.
Here i made some Speedtests and compared the divers SQL Server.Provider Options.
The Queries itself are nearly with the same Speed. But in the first Connect Part of any ServerRequest the prDirect Option uses 120ms on my System to Connect. the prAuto only 10ms that is 12times slower.
We use mORMot as Rest/Soa Service, for every Rest Request the Connection is newly opened.
Some Heavily transfers use 2seconds with prAuto and 10s with prDirect.
The Reason ist the 120ms Connection Time.
Does anybody have a idea why direct connect is that slower ?
prDirect Connect heavily slower then prAuto
Re: prDirect Connect heavily slower then prAuto
Hello,
I unfortunately do not have an answer to your question. I just wonder if you can use pooling? That might help you after first requests or even at the beginning.
However, I am interested in your test project. I failed to use UniDAC with mORMot myself in the past. If you can provide a complete example with necessary database backup that I very much appreciate.
Thanks & regards,
Ertan
I unfortunately do not have an answer to your question. I just wonder if you can use pooling? That might help you after first requests or even at the beginning.
However, I am interested in your test project. I failed to use UniDAC with mORMot myself in the past. If you can provide a complete example with necessary database backup that I very much appreciate.
Thanks & regards,
Ertan
Re: prDirect Connect heavily slower then prAuto
Hi thank you for your answer, i found the reason after 1h debugging.
i had to set SQL Server.ConnectionTimeout to 0 (zero) if it is set to a value > zero in TryConnect a WaitForConnect is called where Connector.Wait Function in CRvioTcp.pas is called which waits approx 90ms in WaitForSingleObject.
Set to 0 InternalConnect instead is called which is extremly faster.
Problem solved.
i had to set SQL Server.ConnectionTimeout to 0 (zero) if it is set to a value > zero in TryConnect a WaitForConnect is called where Connector.Wait Function in CRvioTcp.pas is called which waits approx 90ms in WaitForSingleObject.
Set to 0 InternalConnect instead is called which is extremly faster.
Problem solved.
Re: prDirect Connect heavily slower then prAuto
UniDAC works with MS SQL Server using TCP/IP protocol in the Direct mode, but when using the Native Client, the default protocol is Shared Memory. You can try setting in the Native Client settings that the use of the TCP/IP protocol is required, and this issue will most likely be relevant for the Native Client.
Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.
Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.