Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue - graphql query #2313

Open
brvaland opened this issue May 14, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@brvaland
Copy link

commented May 14, 2019

Hi

Talk: v4.7.0

I have noticed performance issue when i call get asset query against development instance of coral talk which is currently on 1 container hosted in kubernetes. At some time i am getting response under 100ms but some are taking over 1000ms.

On dev environment we don't have huge data or traffic so was expecting return to really quick.

Call logs

 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"f5d30140-7648-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":739,"msg":"http request","time":"2019-05-14T13:05:35.287Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"f83c3910-7648-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":98,"msg":"http request","time":"2019-05-14T13:05:38.691Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"f93761f0-7648-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":25,"msg":"http request","time":"2019-05-14T13:05:40.264Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"fa070e00-7648-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":19,"msg":"http request","time":"2019-05-14T13:05:41.619Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"faba7f80-7648-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":15,"msg":"http request","time":"2019-05-14T13:05:42.791Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"fb8a0480-7648-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":2185,"msg":"http request","time":"2019-05-14T13:05:46.321Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"00eaaa60-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":948,"msg":"http request","time":"2019-05-14T13:05:54.106Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"2095d010-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":18,"msg":"http request","time":"2019-05-14T13:06:46.306Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"3f31cfb0-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":28,"msg":"http request","time":"2019-05-14T13:07:37.671Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"644b56e0-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":451,"msg":"http request","time":"2019-05-14T13:08:40.337Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"77d92340-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":85,"msg":"http request","time":"2019-05-14T13:09:12.778Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"89c610e0-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":14,"msg":"http request","time":"2019-05-14T13:09:42.780Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"9bc37940-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":12,"msg":"http request","time":"2019-05-14T13:10:12.959Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"ad1e8720-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":18,"msg":"http request","time":"2019-05-14T13:10:42.084Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"c0678250-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":495,"msg":"http request","time":"2019-05-14T13:11:14.916Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}
 {"name":"talk","version":"4.7.0","revision":"","hostname":"comments-microservice-54fb5f4df7-gstrf","pid":32,"level":30,"traceID":"e8693550-7649-11e9-ac5f-4d57c8ca0716","url":"/api/v1/graph/ql/api/v1/graph/ql","method":"POST","statusCode":200,"userAgent":"PostmanRuntime/7.11.0","responseTime":1052,"msg":"http request","time":"2019-05-14T13:12:22.593Z","src":{"file":"/usr/src/app/middleware/logging.js","line":20,"func":"res.end"},"v":0}

Postman
Pre-request script

postman.setEnvironmentVariable("query", JSON.stringify(`query GetComments($url: String, $commentLimit: Int, $repliesLimit: Int) 
{
  asset(url: $url) {
    id
    title
    url
    comments (query: { limit: $commentLimit}) {
      nodes {
        id
        body
        user {
          username
        }
        replies (query: { limit: $repliesLimit }) {
          nodes {
            id
            body
          }
        }
      }
    }
  }
}`));

Body

{
    "query": {{query}},
    "variables": {
        "url": "https://localhost:9090/test",
        "commentLimit": 20,
        "repliesLimit": 10
    },
    "operationName": "GetComments"
}

Any advise how to investigate root cause will be appreciated?

@kgardnr

This comment has been minimized.

Copy link
Member

commented May 14, 2019

Hi @brvaland! For more advanced troubleshooting like this, we'd suggest you get in touch with our support team and they can give you a quote to assist you. You can email them at support at coralproject dot net.

@kgardnr kgardnr added the question label May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.