WorkbookFactory.Create causes Azure Function to crash #1038
-
Hello, We have an azure function (timer) that when it runs looks for any files in a specific blob storage folder and if it finds it then opens it for processing. We have this working without any issues until recently. Normally we used to get excel workbooks with couple of sheets - each sheet having anywhere between couple of hundred rows to perhaps about 2 or 3 thousand rows. This kind of volume works like a charm. But recently we have started to receive files that have over 120,000 rows and that's when trouble started. The below line is the last line to execute before the azure function crashes. IWorkbook workbook = WorkbookFactory.Create(fileStream); // the fileStream is passed from the calling function that reads the Blob Storage. From the diagnostic dump the below errors are logged: [Warning] [HostMonitor] Host CPU threshold exceeded (90 >= 80) This only happens when the code is run from Azure (i.e. published to the Azure Function App). We are on an App Service Plan - Premium. The same code works fine when running the Azure function locally in Visual Studio 2022 using local development storage. The Excel files are .xlsx files and the file sizes range from 10MB to 16MB (for the ones creating a problem). They only have text data and no other pictures or graphs etc. In my testing, files with about 90,000 rows (file size approx. 8 MB) work fine. It is only when the row count (and the file size) exceeds 120,000 (or approx 10 MB) when the problems start happening. Anyone seen this type of issues before? Any suggestions? TIA, Aravind |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
120,000 rows is too heavy for Azure function I'm afraid. Azure function is light-weight app-service as I understand. The major problem may be the memory consumption when you handling this huge excel. |
Beta Was this translation helpful? Give feedback.
120,000 rows is too heavy for Azure function I'm afraid. Azure function is light-weight app-service as I understand. The major problem may be the memory consumption when you handling this huge excel.