Constant (expensive) queries from app service hosted drupal image to file storage __lastCheckTime.txt

Dorus Peelen 31 Reputation points
2021-06-18T07:07:38.237+00:00

I have a app service plan running an drupal docker image, with 4 mounted file shares trough Path mappings on the app service: (https://learn.microsoft.com/en-us/azure/app-service/configure-connect-to-azure-storage?pivots=container-linux)

/var/www/html/modules
/var/www/html/sites
/var/www/html/profiles
/var/www/html/themes

Since 2 weeks now, there is a constant stream of attempts to open, read and close the file __lastCheckTime.txt on all 4 shares. Creating around 200 calls/minute, costing about half my total running cost of the file share + app service + mysql database. Azure file cost wend up from 30 cent/month to 30 cent/day.

There is nothing in the docker image that would call __lastCheckTime.txt and the only other place i've ever seen the file is in the /LogFiles folder on the sftp of the app service.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,301 questions
{count} votes

3 answers

Sort by: Most helpful
  1. szymon.urbanik 6 Reputation points
    2022-09-14T11:57:35.467+00:00

    Here is the response I've got from the support:

    The calls to _lastCheckTime.txt are made by the storage health checker from App Service. This is necessary because if the share is unhealthy for long enough, we need to try to auto-recover.

    The health checks are being counted as 3 operations (create, queryinfo, close).

    The health check I/O operations performed by the platform are translated into three distinct operations on the storage account. The platform mounts Azure Files shares using the CIFS driver which uses the SMB protocol to interact with your file share, and performs I/O checks using standard .NET file system libraries, so the engineers do not have direct control over the translation of these operations to the corresponding storage API requests.

    These health checks are necessary to ensure that running applications maintain consistent access to the mounted storage, and to allow the platform to attempt automatic recovery if the mount becomes inaccessible.

    1 person found this answer helpful.
    0 comments No comments

  2. szymon.urbanik 6 Reputation points
    2022-08-25T08:07:23.28+00:00

    Hello
    I have the same issue with Docker image with mounted file shares through Path mappings.
    Did you find any solutions to this problem?

    0 comments No comments

  3. Pedro Guerra 0 Reputation points Microsoft Employee
    2024-06-18T08:23:15.1466667+00:00

    For anyone having this issue, you can decrease the health check frequency by adding the environment variable WEBSITE_BYOS_FILES_HEALTH_CHECK_FREQUENCY and specifying a higher value (the default is 5 seconds).

    By doing so, you will be able to decrease the daily number of transactions caused by the health check mechanism.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.