Open cupcakearmy opened 4 years ago
Do you have cache enabled?
Also, we're caching everything on top of it with cloudflare.
I've enabled it, not it takes "only" ~130ms. There is not way to get that faster I guess then.
For reference:
version: '3.7'
services:
mysql:
image: mysql:5.7
env_file: .env
volumes:
- ./data/db:/var/lib/mysql
directus:
image: directus/directus:v8-apache
env_file: .env
ports:
- 80:80
volumes:
- ./data/config:/var/directus/config
- ./data/uploads:/var/directus/public/uploads
MYSQL_DATABASE=directus
MYSQL_USER=directus
MYSQL_PASSWORD=xxx
MYSQL_RANDOM_ROOT_PASSWORD=yes
DIRECTUS_ENV=production
DIRECTUS_CACHE_ENABLED=true
DIRECTUS_CACHE_RESPONSETTL=3600
DIRECTUS_AUTH_PUBLICKEY=xxx
DIRECTUS_AUTH_SECRETKEY=xxx
DIRECTUS_DATABASE_HOST=mysql
DIRECTUS_DATABASE_PORT=3306
DIRECTUS_DATABASE_NAME=directus
DIRECTUS_DATABASE_USERNAME=directus
DIRECTUS_DATABASE_PASSWORD=xxx
Issue
So the issue is that the api takes really long time to respond to even the simplest requests. I can range from ~150ms in the best cases to even almost a whole second. Basically this makes directus impossible to use in server side rendering. Is there any way to speed up calls? I have not found anything about it in the docs.
Model
The model is really simple. It is a sorted model with just 2 text fields. So nothing complicated
Pics (~700ms & ~200ms)
Versions
Pulled the latest image before creating the issue