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

Postgresql is slower than mariadb (graphql, ping) #7478

Closed
approached opened this issue Feb 1, 2021 · 5 comments
Closed

Postgresql is slower than mariadb (graphql, ping) #7478

approached opened this issue Feb 1, 2021 · 5 comments
Labels

Comments

@approached
Copy link

Description

I was wondering why is graphql so slow. Than i make simple test. I installed two instances and simple ping request. The result is completely different. Just see screenshot:

MariaDB 10.3:
Screen Shot 2021-02-01 at 15 23 32

PostgreSQL 13.1:
Screen Shot 2021-02-01 at 15 28 53

If i work with real data queries. Than it took 300 - 800 ms. 👎

Steps to reproduce

  1. Install two instance of craftcms (1 MariaDb, 1 Postgresql)
  2. Send a request:
query MyQuery {
  ping
}

Additional info

  • Craft version: 3.6.2
  • PHP version: 7.4
  • Database driver & version: MariaDB 10.3 / PostgreSQL 13.1
  • Plugins & versions: -
@approached approached added the bug label Feb 1, 2021
@brandonkelly
Copy link
Member

We haven’t seen any significant differences in our own testing.

Were you testing with the exact same content structures (sections, entry types, fields, etc.)? If not, that is likely the main culprit. Most of GraphQL’s slowness can usually be attributed to its work defining the schema, which unfortunately isn’t cacheable yet.

@approached
Copy link
Author

Both installs are complete fresh. I used the command from docs: https://craftcms.com/docs/3.x/installation.html#downloading-with-composer

composer create-project craftcms/craft craft_mysql
and
composer create-project craftcms/craft craft_postgres

Both databases are in docker container.

BTW: It is just a ping call. Not a query for entries.

@brandonkelly
Copy link
Member

brandonkelly commented Feb 4, 2021

Hm, in that case perhaps this is a network routing issue with your Postgres server. We can’t reproduce this.

Feel free to write into support@craftcms.com if you want us to help you look into your setup further – but this isn’t a Craft-specific issue AFAICT.

@approached
Copy link
Author

BTW: Everything was runnning on local machine.

@brandonkelly
Copy link
Member

Yeah I thought that could be the case, but that doesn’t rule out networking issues.

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

No branches or pull requests

2 participants