简体   繁体   English

从其中调用EC2服务时,为什么AWS Lambda变慢?

[英]Why AWS Lambda is slow when calling EC2 service from it?

I am using trial version of AWS instance and have free EC2 server of 1GB RAM. 我正在使用AWS实例的试用版,并具有1GB RAM的免费EC2服务器。

I have Mongo DB installed in EC2 and written one simple AWS Lambda function in Java(tried in Node js too). 我在EC2中安装了Mongo DB,并用Java编写了一个简单的AWS Lambda函数(也在Node js中尝试过)。 Both are in same region. 两者都在同一地区。

When I am trying to save one simple JSON in DB of EC2 byLambda function, its taking too long time around 30 seconds and then getting time out. 当我尝试通过Lambda函数在EC2的DB中保存一个简单的JSON时,它花费的时间过长,大约30秒,然后超时。

I also tried to put a message in Kafka queue which is installed on simillar kind of EC2 server using Lambda function, its taking almost a minute to put that message in Kafka queue. 我还尝试将消息放入使用Lambda函数安装在类似EC2服务器上的Kafka队列中,将消息放入Kafka队列几乎需要一分钟。

Why this is sooooooo slow? 为什么这太慢了? Am I missing something or shall we blame the 1GB Ubuntu/Linux EC2 server? 我是否缺少某些东西,还是应该归咎于1GB Ubuntu / Linux EC2服务器? Or something fishy about AWS Lambda? 还是有关AWS Lambda的一些东西? Tried with both Java and Node JS? 尝试过Java和Node JS吗?

Worked when I create Security group in EC2 console for my DB and provide DB port in port range. 当我在EC2控制台中为数据库创建安全组并在端口范围内提供数据库端口时起作用。 Check attached image. 检查附件图像。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM