最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

sql server - AWS Lambda and long execution times of T-SQL queries - Stack Overflow

programmeradmin1浏览0评论

I have an AWS Lambda, based on typescript, that calls SQL Server (located on an AWS EC2 instance), using node-mssql library for this purpose.

I would like to trace the request and find the bottleneck. In my code I can cover the calling method and calculate the time.

So, the request can be split into the following parts:

  1. init calling on Lambda's side
  2. the part from lambda to EC2 (network delay)
  3. the "incoming" part inside EC2 refers to the time when the virtual server calls SQL Server internally
  4. T-SQL query execution time
  5. the "outcoming" part inside EC2
  6. the part from EC2 to lambda (network delay)
  7. return the result to the calling code

I'm confident about step #4; I profiled the SQL query time, and it's quite small.

So, the problem lies in another step or steps.

I'm exploring X-ray and have configured it for calling S3 as an example, but there seems to be no way to profile the node-mssql library (perhaps another library could work?). Therefore, I'm unsure how to implement this in practice.

My idea is that we can at least monitor the network parts (#2 and #6) because I don't see any barriers to observing network requests (but I did not find how to do it using X-ray). Additionally, since EC2 is part of the AWS family, it probably could provide us with some helpful insights or tools.

Any ideas and suggestions? :)

Thanks

发布评论

评论列表(0)

  1. 暂无评论