Hey Kay0291 -
Your logs suggest the app is running out of memory: exit code 137 means the OS killed your process (likely exceeding Databricks Appsโ 2 vCPU/6GB RAM limit). This often happens when both Next.js and FastAPI run together, especially under load, and can lead to ECONNRESET errors when the backend crashes and the frontend canโt connect.
Quick tips:
- Monitor memory use locally under similar load and check for memory leaks or heavy caching in your code.
- Reduce the number of worker processes for both Next.js and FastAPI to stay within the memory cap.
- Scale down concurrent users or requests if possible, and offload heavy tasks to Databricks Jobs or Model Serving.
- If the issue persists and isnโt memory-related, check for missing environment variables or dependency issues.
Note that Databricks Apps is designed for Python API backends with static JS/React assetsโserver-side Node.js isnโt fully supported. More flexible compute options are planned for the future.
Let me know if you need more details on any of these steps!
Best
Sarah