You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.[High Decay test](./scenario1-high-decay): Test rapid temp file accumulation and disk decay
@@ -52,14 +63,46 @@ Last updated: 2025-08-27
52
63
> Each scenario includes detailed deployment guides that explain different approaches:
53
64
54
65
1. High-Decay (Writable Approach), click here for [quick deployment guide](./scenario1-high-decay/DEPLOYMENT.md)
55
-
-**Deployment Method**: Standard deployment (extracted to wwwroot)
56
-
-**File Access**: Files are writable by the Function App
57
-
-**Pipelines**: Azure DevOps pipeline with standard deployment
58
-
59
66
2. Optimized (Mounted Package Approach), click here for [quick deployment guide](./scenario2-optimized/DEPLOYMENT.md)
60
-
-**Deployment Method**: ZipDeploy with `WEBSITE_RUN_FROM_PACKAGE=1`
61
-
-**File Access**: Files are read-only (mounted from zip)
62
-
-**Pipelines**: Azure DevOps pipeline with ZipDeploy or GitHub Actions workflow
67
+
68
+
### High-Decay (Writable Approach)
69
+
70
+
> The combination of writable deployment, intensive logging, and full diagnostics causes Azure Functions to generate and buffer a large amount of telemetry and log data in local temp storage. This leads to rapid disk usage growth, temp file accumulation, and eventual disk decay:
71
+
72
+
-**Deployment Method**: Standard deployment (extracted to wwwroot)
73
+
-**File Access**: Files are writable by the Function App
74
+
-**Pipelines**: Azure DevOps pipeline with standard deployment
75
+
76
+
> [!IMPORTANT]
77
+
> Overall, the problem with standard/writable deployment with intensive logging:
78
+
> -**Intensive logging and diagnostics** (full Application Insights, detailed diagnostics, verbose log level) generate a large volume of log and telemetry data.
79
+
> -**Writable deployment** (`WEBSITE_RUN_FROM_PACKAGE = 0`) means the function app runs from extracted files in `wwwroot`, allowing the app and platform to write files locally.
80
+
> -**Azure Functions and the platform buffer logs, telemetry, and temp files in the local file system**, specifically under `C:\local\Temp` and `D:\local\Temp` (on Windows plans).
81
+
> -**Telemetry and diagnostic logs are first written to local temp storage** before being sent to Application Insights or other destinations.
82
+
> -**High load and verbose logging** cause rapid accumulation of files in these temp directories.
83
+
> -**Disk usage grows over time** as temp files, logs, and telemetry buffers accumulate, especially if the app is under sustained or bursty load.
84
+
> -**Some files may remain locked or not be cleaned up automatically**, even after a function app restart, leading to "disk decay" (progressive loss of available disk space).
85
+
> -**Performance degrades** as disk fills up, and the app may eventually fail if the temp storage is exhausted.
86
+
87
+
### Optimized (Mounted Package Approach):
88
+
89
+
> The combination of mounted (read-only) deployment, optimized logging, and minimal diagnostics causes Azure Functions to generate and buffer very little telemetry and log data in local temp storage. This prevents disk usage from growing, avoids temp file accumulation, and eliminates disk decay:
90
+
91
+
-**Deployment Method**: ZipDeploy with `WEBSITE_RUN_FROM_PACKAGE=1`
92
+
-**File Access**: Files are read-only (mounted from zip)
93
+
-**Pipelines**: Azure DevOps pipeline with ZipDeploy or GitHub Actions workflow
94
+
95
+
> [!IMPORTANT]
96
+
> **Overall, the benefit with optimized (mounted) deployment and minimal logging:**
97
+
> -**Minimal logging and diagnostics** (Application Insights with sampling, reduced diagnostics, less verbose log level) generate far less log and telemetry data.
98
+
> -**Mounted deployment** (`WEBSITE_RUN_FROM_PACKAGE = 1`) means the function app runs from a read-only mounted package, preventing the app and platform from writing files to `wwwroot`.
99
+
> -**Azure Functions and the platform buffer far fewer logs and temp files in the local file system**, reducing writes to `C:\local\Temp` and `D:\local\Temp`.
100
+
> -**Telemetry and diagnostic logs are sampled and sent directly to Application Insights or other destinations,** with minimal local buffering.
101
+
> -**Even under high load, temp file accumulation is negligible** because the app and platform cannot write to the mounted package and logging is optimized.
102
+
> -**Disk usage remains stable over time** as temp files, logs, and telemetry buffers are minimized and cleaned up efficiently.
103
+
> -**Restarts are rarely needed** for disk cleanup, and locked files are uncommon.
104
+
> -**Performance remains consistent** even under sustained load, as disk space is preserved and temp file decay is prevented.
0 commit comments