Mongo ACA scale down to 0 but still scale to 1 when there is no activity

Paul 0 Reputation points
2024-02-17T12:26:55.29+00:00

Hi, I'm experimenting with running a mongo server in ACA with persistent storage being Azure File Share. Everything works. What i'm seeing in log analytics is that the ACA get created, started and stopping very often during the day even though nobody is connecting to the mongo for sure and this is driving the cost up quite significantly. Here are the logs in log analytics User's image

Does someone have an idea why this is ? I have other ACA that are web app that doesn't have this behavior, when they are scaled down to 0, it will stay this way until I hit the web app url. I was expecting the same for my mongo inside ACA, that once it is scaled down to 0, it will stay this way until I connect to the mongo server but it seems to start when I'm not connecting to it. This is experimentation, and nobody is connecting to it except me. And I'm for sure not connecting to it at 3 AM, 4 AM, etc Thanks,

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
327 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 23,256 Reputation points
    2024-02-26T17:47:20.6533333+00:00

    @Paul Thanks for reaching out. As mentioned by Anthony Public port scanning traffic could be hitting your ACA instance periodically and causing it to start up and shut down frequently. This is a common issue with publicly exposed services, and it can be difficult to prevent.

    One way to mitigate this issue is to use a firewall or NSG to restrict access to the MongoDB server. You can configure the firewall or NSG to only allow traffic from specific IP addresses or ranges, which can help reduce the amount of port scanning traffic hitting your ACA instance.

    Another option is to use a reverse proxy or load balancer to route traffic to the MongoDB server. This can help hide the server's IP address and make it more difficult for attackers to target it with port scanning traffic.

    do let me know incase of further queries, I would be happy to assist you.

    Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    0 comments No comments