I have a test wordpress site in kubernetes on Azure using Azure Storage. It works, but VERY VERY slowly.
Here's the config:
apiVersion: v1
kind: PersistentVolume
metadata:
name: wordpress-volume
namespace: cadlearning
labels:
type: slow
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
storageClassName: azurefilestorage
azureFile:
secretName: storage-secret
shareName: wordpress
readOnly: false
mountOptions:
- dir_mode=0777
- file_mode=0777
- uid=1000
- gid=1000
- mfsymlinks
- nobrl
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wordpress-volume-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
storageClassName: azurefilestorage
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress-deployment
namespace: cadlearning
labels:
app: wordpress
spec:
replicas: 1
selector:
matchLabels:
app: wordpress
strategy:
type: Recreate
template:
metadata:
labels:
app: wordpress
spec:
containers:
- image: wordpress:latest
name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: mysql.database.azure.com
- name: WORDPRESS_DB_NAME
value: BetaWWW
- name: WORDPRESS_DB_USER
value: admin
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: wordpress-db
key: password
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: azurefileshare
mountPath: "/var/www/html"
volumes:
- name: azurefileshare
persistentVolumeClaim:
claimName: wordpress-volume-claim
This is the sum of the configuration. But requests are brutally slow. And looking at the logs, (there's no errors), it is very slow to even receive the request and see anything in the logs.
I've followed this: https://ahenriksson.com/2020/01/27/how-to-set-up-wordpress-behind-a-reverse-proxy-when-using-nginx/ in the hopes that it was on the ingress that the problem lay without any success.
Once it starts responding everything loads very quickly. It's just that initial delay of about 9 seconds that kills it.
So I'm at a loss. How do I get wordpress on azure kubernetes to respond quickly?