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

Akismet module loads and performs a full table scan on every request (for no reason) #27

Open
madmatt opened this issue Jan 14, 2019 · 3 comments

Comments

@madmatt
Copy link
Member

madmatt commented Jan 14, 2019

Loading the AkismetMiddleware on every request doesn't seem necessary, and causes unnecessary database queries to be run even when Akismet isn't in use.

Instead of loading Akismet via a middleware, surely it should just be loaded whenever a form is shown or submitted that includes the AkismetField?

@ScopeyNZ
Copy link

I'm not sure that the middleware does anything that's taxing? Looking at it it will only set the API key when the middleware boots up?

@madmatt
Copy link
Member Author

madmatt commented Jan 15, 2019

It calls $this->isDBReady() which ultimately does a full table scan. Normally this isn't too bad, but we've run into some issues with MySQL/MariaDB deadlocking these full table scans for... no good reason we can see. We investigated one cause of these table scans and it led back here. It's not the only code doing this, but it seems unnecessary to do this here.

@ScopeyNZ
Copy link

I see yeah. isDBReady is usually just a simple "a connection exists" call so I glanced over it. It seems a little odd that it's pretty much just asserting dev/build has been run!

I'd vote we just remove it and have isDBReady just check the connection is ready.

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

No branches or pull requests

3 participants