So on your Nextcloud server you use an external DNS and it greatly sped up you nextcloud? Because I noticed a few years back mine got slow and I cannot figure out why. It was about the time I enforced pihole dns with pfsense. I might need to try this.
I’m going to have to give this a shot tonight, need to make a pfsense rule to allow the server to get out and then change its DNS. Regarding php, my current config is the following because I have over 64gigs of ram and went through great length to get Nextcloud to cache MORE into ram:
pm.max_requests = 50000 #set higher, the process is recyled after 50k calls to prevent memory leaks pm.max_children = 1000 pm.start_servers = 60 pm.min_spare_servers = 30 pm.max_spare_servers = 120