platform icon indicating copy to clipboard operation
platform copied to clipboard

Data lake api /blob/platform/id is slow

Open denis-tingaikin opened this issue 1 year ago • 2 comments

Sometimes getting resources from the data lake via the /blob/platform API takes too much time, up to 2 min.
We need to find what exactly takes this time.

Steps to reproduce:
\

  1. find any player that can run hls video\
  2. paste link to our hls file https://front.hc.engineering/blob/platform/260e3759-2b60-402d-8379-1a11d7dc4c67\
  3. play the video

    Actual: sometimes we’re getting spikes up to 2 min.

denis-tingaikin avatar Jan 29 '25 03:01 denis-tingaikin

Connected to Huly®: UBERF-9277

huly-github-staging avatar Jan 29 '25 03:01 huly-github-staging

Seems like it can be related to db.

Sometimes db.getBlob works up to 5s

{
  "$cloudflare": {
    "truncated": false,
    "event": {
      "request": {
        "url": "https://dl.hc.engineering/blob/platform/REDACTED",
        "method": "GET",
        "path": "/blob/platform/REDACTED"
      }
    },
    "scriptName": "datalake-worker-staging",
    "eventType": "fetch",
    "executionModel": "stateless",
    "scriptVersion": {
      "id": "450f1c8a-f09e-4415-be2e-e98f3c8462b9"
    },
    "$metadata": {
      "requestId": "90b9d44ea8cd6901",
      "id": "01JK36KW4BZE2PR004YZPY6XFN",
      "type": "cf-worker",
      "messagePattern": "GET <URL> total=<NUM> <DOMAIN>=<NUM> <DOMAIN>=<NUM>"
    }
  },
  "message": "GET https://dl.hc.engineering/blob/platform/6e9c65d5-8674-4a09-b99c-4d231c8634b0 total=817 db.getBlob=721 r2.get=96",
  "ops": [
    {
      "op": "db.getBlob",
      "time": 721
    },
    {
      "op": "r2.get",
      "time": 96
    }
  ],
  "total": 817
}		

{
  "$cloudflare": {
    "truncated": false,
    "event": {
      "request": {
        "url": "https://dl.hc.engineering/blob/platform/REDACTED",
        "method": "GET",
        "path": "/blob/platform/REDACTED"
      }
    },
    "scriptName": "datalake-worker-staging",
    "eventType": "fetch",
    "executionModel": "stateless",
    "scriptVersion": {
      "id": "450f1c8a-f09e-4415-be2e-e98f3c8462b9"
    },
    "$metadata": {
      "requestId": "90b9fae40508f84e",
      "id": "01JK3843P163ZKY547W9KFW400",
      "type": "cf-worker",
      "messagePattern": "GET <URL> total=<NUM> <DOMAIN>=<NUM> <DOMAIN>=<NUM>"
    }
  },
  "message": "GET https://dl.hc.engineering/blob/platform/1376fe75-0fe5-48dd-98ef-2564388bc840 total=1062 db.getBlob=922 r2.get=140",
  "ops": [
    {
      "op": "db.getBlob",
      "time": 922
    },
    {
      "op": "r2.get",
      "time": 140
    }
  ],
  "total": 1062
}

{
  "$cloudflare": {
    "truncated": false,
    "event": {
      "request": {
        "url": "https://dl.hc.engineering/blob/platform/REDACTED",
        "method": "GET",
        "path": "/blob/platform/REDACTED"
      }
    },
    "scriptName": "datalake-worker-staging",
    "eventType": "fetch",
    "executionModel": "stateless",
    "scriptVersion": {
      "id": "450f1c8a-f09e-4415-be2e-e98f3c8462b9"
    },
    "$metadata": {
      "requestId": "90b9fae305bbcc42",
      "id": "01JK3843K9HEZNEMX7V8AJ5YNA",
      "type": "cf-worker",
      "messagePattern": "GET <URL> total=<NUM> <DOMAIN>=<NUM> <DOMAIN>=<NUM>"
    }
  },
  "message": "GET https://dl.hc.engineering/blob/platform/16c61b9c-d348-4aa7-b012-a47c527f5e59 total=1136 db.getBlob=912 r2.get=224",
  "ops": [
    {
      "op": "db.getBlob",
      "time": 912
    },
    {
      "op": "r2.get",
      "time": 224
    }
  ],
  "total": 1136
}
{
  "$cloudflare": {
    "truncated": false,
    "event": {
      "request": {
        "url": "https://dl.hc.engineering/blob/platform/REDACTED",
        "method": "GET",
        "path": "/blob/platform/REDACTED"
      }
    },
    "scriptName": "datalake-worker-staging",
    "eventType": "fetch",
    "executionModel": "stateless",
    "scriptVersion": {
      "id": "450f1c8a-f09e-4415-be2e-e98f3c8462b9"
    },
    "$metadata": {
      "requestId": "90b9fae300502a15",
      "id": "01JK3845HCQK6CPRJAK1JGZ8H2",
      "type": "cf-worker",
      "messagePattern": "GET <URL> total=<NUM> <DOMAIN>=<NUM> <DOMAIN>=<NUM>"
    }
  },
  "message": "GET https://dl.hc.engineering/blob/platform/6a84e40a-f07a-4e99-8500-d19907d65141 total=3111 db.getBlob=2946 r2.get=165",
  "ops": [
    {
      "op": "db.getBlob",
      "time": 2946
    },
    {
      "op": "r2.get",
      "time": 165
    }
  ],
  "total": 3111
}

denis-tingaikin avatar Feb 02 '25 11:02 denis-tingaikin