Long response from graph sometimes

Sometimes request to subgraph polygon-v2 takes 5-6 seconds, instead of 200-300ms.
https://api.thegraph.com/subgraphs/name/unlock-protocol/polygon-v2
Can you help to to figure it out?

1 Like

Hey @iskiridomov, can you also check if it’s a specific query that’s slow? If so we might be able to speed it by creating indexes
Or is it all the queries to the subgraph is slow?

1 Like

No, i’t only 1 of 10-15 same queries. Most of them are respond within 200-300ms. But sometimes it take 5-6 seconds and UI freeze these times.

2 Likes

Query is same but different params

{
          keys(where: { owner: "${
            this.walletAddress
          }", lock_in: ["${Object.values(environment.contractAddress).join(
        '", "'
      )}"] }) {
            id
            lock {
              id
              name
            }
            expiration
          }
        }

contracts:

contractAddress: {
    alpha: '0x45009830025140dd71cc34a7df93313545ed0598', //admin
    beta: '0xd3ef2892575f86022d94c1454c2cc6e6ea710223',
    eat: '0xb6db2c1923dad7411dad2c0c16c9997e5a481fe8',
    binance: '0x6d027a56efa85f1d21dda0a99741aaab8109a389',
    marketing14: '0xaf5c99dd10f7a85fafbd1d4e0e7dee31572808e4',
    marketing7: '0x8235cc458ebd2fe8ec1319e45a916b320888863e',
    cicap: '0x28225492ae17954463e3417dab982a7bc3578ad8',
  },
2 Likes

Here is a response time chart, as you can see there is a spikes with huge response time

2 Likes

2 Likes

@iskiridomov Thanks, we’ll take a look internally, we might be able to speed that query up with an index. will ping internally

2 Likes