0

I've been running my PoC on Fargate without many problems. It's a Micronaut Java app with not much happening on its own. I'm using the smallest 256mb/0.25CPU Fargate deployment.

I'm running a simple command from java code, prettier --version. Locally it takes less than a second, even when I'm running a container with 256mb/0.25CPU limits. On Fargate, though, it takes ridiculous 9-10 seconds. My container insights don't show anything that might explain this (screenshot).

The problem is in this specific command; If I run, for example, node --version, it's blazing fast. Prettier is a code formatter run by node.

What could cause this? It's hard to debug - since it's Fargate, I have no way to execute anything in a container without redeploying it. Logs are also not helpful. Is it somehow related to a thread spawned by Java?

My biggest question is why such a drastic difference between running locally and on ECS?

2
  • 1
    I would increase CPU to something like 4.0 temporarily and run the command again to see if that helps. Then try similar with RAM, and then together. If that helps then the problem is Fargate resources. If not I would wonder if there's some latency issue somewhere with a resource it needs.
    – Tim
    Commented Jan 26, 2022 at 17:30
  • 1
    There's a lot of difference between running locally vs Fargate, and potentially even Fargate vs ECS on EC2. Fargate is basically a serverless service, so lots of allocation and magic is happening behind the scenes. Add a ton of logging, see if running the prettier command directly in a contianer is different to calling it from Java?
    – shearn89
    Commented Jan 27, 2022 at 8:47

0

You must log in to answer this question.

Browse other questions tagged .