Node.js application Buffers are created as empty in ECS Fargate

0

Hello, I'm running a NodeJS microservice API on ECS Fargate.

One of these services uses NodeJS's Buffer.from constructor to create a new buffer from a string however the buffer creation is faulty and it seems to happen only with the deployed ECS Fargate version (testing locally as well as a built copy on a separate server and there it works, buffer is properly created). For some reason, Buffers created in ECS Fargate are empty - they are valid Buffers but the size is 0 bytes when it should be 32 bytes.

Debugging shows that the payload exists the moment the Buffer is being created. I'm a first time user of Fargate and ECS in general and I have no idea if there are some kind of hidden limitations with ECS runtimes that I can't seem to find from documentation.

The service is allocated with 0.25vCPU and 1GB of RAM. From graphs I can see that the CPU utilization is 10% and MemoryUtilization is 8% so it doesn't seem to be an actual resource starvation that is causing it.

Is this intended behaviour with ECS or is this something that is configurable or am I just overlooking something?

  • It should not have any issues. Are you done something similar to this? |

    var buf = Buffer.from('abc');
    console.log(buf); 
    

    If yes, it shouldn't create an empty buffer. What about the logs? What are you seeing on them?

kurbar
已提問 1 年前檢視次數 48 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南