-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1663445: How to reduce number of login/session requests? #1025
Comments
hi and thanks for raising this question here. On the second point (warehouse optimisation) we might not be able to help here, as it is entirely independent from this particular driver library. But we do have some material on the topic, such as
regarding the first question which is more related to the library here, the I believe what you seeing is closely correlated with the usage pattern mentioned here, which if I'm correct, is:
Maybe you need to discard the session and close the connection after each query but if not, you could consider calling Speaking about which, we have a parameter CLIENT_SESSION_KEEP_ALIVE which when set to Again, this only makes sense if you do not need to close the session and can keep them around and reused. Raising another question for me, why does a single login take 5.6s on the average. That might be expected (e.g. if your client sits 'far' away from the Snowflake account, e.g. source is in Europe and SF account is in AWS Tokyo for example), but might be unexpected too. Please note Hope this helps somewhat moving forward. |
@sfc-gh-dszmolka Thanks for very comprehensive answer! I will be investigating CLIENT_SESSION_KEEP_ALIVE and |
First, I checked parameter CLIENT_SESSION_KEEP_ALIVE=true. Still I had
Second, I added INSECUREMODE=true (for testing purpose). Then suddenly latency dropped!
It looks that we have an issue with cert validation, correct? |
indeed if the average latency of login-request drops so drastically by not changing anything just turning certificate validation off, then indeed the focus of the investigation should be this aread. It's a very frequent issue that these endpoints are blocked on a particular network, operating on port 80. (although absolutely no customer or useful data is transmitted on the wire unencrypted, everything is already public information like the CRL itself. Could you please make sure they are reachable? Perhaps not, and driver spends the most of the time waiting for the response. Most optimal would be of course if it would be possible to write a small application which can use the same .NET driver on the same host, downloading the CRLs from within the C# app. Another (although very rare) possibility is that CRL endpoints are reachable, CRL can be downloaded, but driver has issues parsing the content e.g. to a bad openssl installation on the host. I also saw you created 00848448 with Snowflake Support, so I would like to ask whether you prefer continuing working with us in a more private and regulated environment (Support case) , or here ? My colleague already requested the DEBUG level logs from you, which usually best shared privately and not the world :) without sanitizing it, of course. Having the verbose logs usually provides very useful information but if you could do the aforementioned connectivity tests, that should be also helpful. |
Before I received your answer, I had created support ticket 00848448 to to get an answer faster 😉 Honestly, I prefer Github due to interface and usability. However I would like to avoid putting all logs in public here. I send DEBUG logs today in support ticket. I added endpoint in order to check cert reachability from host machine. Here is the result:
|
thank you for checking. All 3 endpoints you listed here, seem to be reachable on HTTP. I'm now closing down this issue to keep the efforts in one thread, which will be the support case (due to the sensitiveness of data needed, the logs). |
It's question about General Usage, not Feature request.
What is the current behavior?
I use snowflake connector in Asp.Net WebAPI service in low-traffic environment (12k GET queries within a week. Peak 200 requests per hour).
See metrics:
I see that apart from
query-request
provider executes additional heavy requestslogin-request
andsession
under the hood.Is it possible to reduce number of these requests somehow?
Is there any variable in connection string that I can manipulate number of sessions/login (now I use default connection string settings and login via password)
The connection class is used more-less this way - is it correct?
What is the desired behavior?
I would like
login-request
andsession
query-request
Configuration
The text was updated successfully, but these errors were encountered: