<@ULVA73B9P> What are the minimum resources for th...
# ask-marvin
c
@Marvin What are the minimum resources for the GCP Cloud Run prefect worker if I'm running it myself? I keep seeing flows entering
Crashed
state when I submit around 5 or more at the same time.
m
Your issue with flows entering a
Crashed
state when submitting multiple flows simultaneously on GCP Cloud Run might be due to resource limitations or infrastructure timeouts. Here are some insights and suggestions: 1. Resource Allocation: Ensure that your Cloud Run service is configured with sufficient CPU and memory resources. The minimum recommended resources for running Prefect workers on Cloud Run are typically 1 CPU and 512 MiB of memory, but scaling these up may be necessary depending on the workload. 2. Concurrency and Autoscaling: Cloud Run has concurrency settings that determine how many requests a single instance can handle simultaneously. If you're hitting the concurrency limit, consider increasing it or deploying more instances. Also, ensure that autoscaling settings are properly configured to handle bursts of flow submissions. 3. Timeouts and Heartbeats: According to GitHub issues, Prefect struggles with elastic compute environments like Kubernetes, which might apply to your Cloud Run setup. Consider setting up heartbeat mechanisms to better handle infrastructure timeouts and prevent "ghost runs." 4. Error Handling: Review your flow's error handling and retry logic. Implementing robust error handling can help manage transient issues that might lead to crashes. 5. Monitoring and Logging: Utilize Cloud Run's logging capabilities to monitor the worker's performance and identify potential bottlenecks or errors that occur during execution. For more detailed guidance, you can refer to the Prefect GCP worker guide. If the issue persists, you might want to explore Prefect's community forums or GitHub for similar cases and potential solutions.