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?
prettier
command directly in a contianer is different to calling it from Java?