-
Notifications
You must be signed in to change notification settings - Fork 133
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
Connecting to Snowflake very slow in AWS Lambda #407
Comments
hi, thank you for raising the issue and major kudos for the self-contained reproduction. the issue can be reproduced at will, thanks to the instructions. i thought specifying envvar anyways. as an immediate relief, I found that configuring insecure mode with configure({ insecureConnect: true }); in can you please try it and see if it helps improving the execution speed for you too ? in parallel, we're going to take a look why the OCSP validation is so super slow when code is deployed with |
also discovered that even without configuring so at this point i'm not entirely sure if the issue is with the connector. can you please try it, just excluding |
Thanks for looking into it so quickly. You are right, removing nodejs/node#41541 I was able to get similar good performance with
Although that increases bundle size from 3.7MB to 24MB. So you need to choose either better stack traces or smaller bundle size. I think it's still worth investigating the OCSP validation when the source maps are enabled and code is bundled with esbuild - we didn't have this problem with any other library so far. |
yes indeed, maybe it's still worth digging into this a bit further. passed this to my colleagues to look into it with low priority, so i don't expect any quick updates on the root cause, but will update this Issue too once there's any news available back |
closing this Issue as there is a working solution to it, also doesn't seem to be directly coming from the Snowflake nodejs driver as you mentioned previously
we'll focus the resources on other, higher priority issues |
node --version
andnpm --version
)?Node: v14.21.2
NPM: 6.14.17
Node on lambda: nodejs14.x
AWS Lambda runtime
Node 14.x
memory: 1024 MB
timeout: 15 min
region: us-east-1
npm list
)?What did you do?
Bootstrapped new serverless project with typescript, added simple connection to snowflake and deployed it.
What did you expect to see?
Connection made within milliseconds or seconds (excluding cold start time for lambda)
What did you see instead?
Connection made in minutes.
Example logs:
Does increasing memory helped?
A bit, but still very slow. With 2048 MB connection took 2 min 12s.
Repo with sample project to reproduce:
https://github.com/sher04lock/sftest
Please note the timestamps in above logs.
Duration of a function was 291334.88ms (4 min 48s), Init duration was only 1412.29ms (not event 1.5s)
This problem does not occur when invoking function locally (either via serverless, or directly JS file which was created by
serverless package
command).The text was updated successfully, but these errors were encountered: