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

Slow Query #165

Open
PaddyLock opened this issue Nov 26, 2018 · 3 comments
Open

Slow Query #165

PaddyLock opened this issue Nov 26, 2018 · 3 comments

Comments

@PaddyLock
Copy link

I am using api-guard in the normal way. When I look at the query times in the debug toolbar, the api-guard query is always tagged as slow:

select * from api_keyswherekey= '0b0c7be24c74c79c7efe7568b770749f1599cf60' andapi_keys.deleted_at is null limit 1

Time = 184.12ms

Why is the query so slow?
What can I do to speed it up?

If I run the query direct on my database then it runs very quickly.

@ratatatKE
Copy link

Hi @PaddyLock, please list technical details of your installation:

  • Application version/details
  • Your MySQL database size
  • Application environment/Server details
  • MySQL database version/details

Please be very very granular in your breakdown so that someone can get context of the scenario and see whether we can reproduce your issue.

@PaddyLock
Copy link
Author

PaddyLock commented Nov 30, 2018

Hi @ratatatKE here are the details

"require": {
        "php": "^7.1.3",
        "barryvdh/laravel-debugbar": "^3.2",
        "chrisbjr/api-guard": "4.*",
        "darkaonline/l5-swagger": "5.7.*",
        "fideloper/proxy": "^4.0",
        "flow/jsonpath": "^0.4.0",
        "folklore/graphql": "^1.1",
        "laravel/framework": "5.7.*",
        "laravel/telescope": "^0.1.5",
        "laravel/tinker": "^1.0",
        "league/flysystem-cached-adapter": "^1.0"
    },

MySQL 5.5.53 hosted on AWS RDS db.m4.xlarge
encoding: utf8mb4
engine: innoDB
only two rows in api_keys table

Server is a Docker instance: nginx, php 7.2.

I am running the docker instance locally and connecting to the RDS database externally. All other DB connections run a lot faster. It's just the api key check that shows in the profiler as being slow.

@PaddyLock
Copy link
Author

PaddyLock commented Nov 30, 2018

screen shot 2018-11-30 at 14 35 58

@ratatatKE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants