I have written 8 GET APIs to load in a single page for different dropdowns. All APIs hitting Azure SQL data warehouse to get the record amount of 10 to 15 as they are all dimensions. But out of 8 randomly on the first load one of the APIs take 20 to 30sec where others load in 2 to 3 seconds.
Below is the code snippet for one of the functions. All APIs are same like the below.
import logging
import json
import azure.functions as func
from api.ProjectDetail.ProjectDetails import *
async def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Trigger function for list.')
BigCategory = req.params.get('BigCategory')
if req.method == "GET":
response, status_code = await ProjectList().get_List1()
return func.HttpResponse(body=response,status_code=status_code)
Here this get_List1() just connect to the data warehouse using PyODBC library.
I have FUNCTIONS_WORKER_PROCESS_COUNT set to 10 in the function app application settings.
Any clue why this happens?