简体   繁体   中英

Lambda function timing out on simple connection to redis

I have a very small lambda function whose sole purpose is to receive webhooks from Segment.io and add a user ID and timestamp to a Redis hash via HSET.

This process is reasonable volume, 100-200 requests per minute. Yet for some reason, I'm observing many of the HSET requests time out of the 5 second limit I set on the Lambda function.

图片

I'm using the free tier of Heroku Redis. I hooked up Redis monitor and this is all I'm seeing:

Redis的

So it doesn't seem like Redis is timing out, but more that Lambda is having an issue or that for some reason Lambda can't make the connection to Redis and times out—but I'm not sure.

What is going on here? Is this a known issue with Heroku Redis and should I try something else? The reason I wanted to use Heroku Redis for this is that I'm using Heroku Links (the foreign data wrapper), but I could set up the FDW with an outside Redis instance as well.

Update: I tried moving this off of Lambda to a separate microservice server (a Heroku service, to be consistent). I saw the exact same issues of repeated timeouts, with Redis having no record of slow operations. Adding New Relic to the server showed only incredible metrics--as far as New Relic is concerned, every request completes within 5ms, meaning the timing out is happening before the application. Is it possible this is happening at the routing layer? Or that (unbelievably, to me) Node somehow isn't scaling to this number of requests per second?

这对我们来说只是一个愚蠢的错误 - 服务器在某些情况下从未向客户端返回响应,因此它超时了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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