potentially related
Pretty much at a loss here because I've been messing around with this for quite a while and can't seem to nail down the issue.
I migrated a small existing Flarum forum from a different cloud platform to Azure. Didn't make any major changes to the configuration, everything went pretty smoothly. The issue is that the forum is extremely slow. It takes about 8-10 seconds just to load the homepage. Loading any pages with posts takes about 4-5 seconds.
I checked a lot of different things so I'll list them here individually.
Forum size
This isn't a large forum by any means. We have under 15 users and something like 100 total posts. The SQL dump is like 300kb.
Hosting
The forum is hosted with Azure App Service + Azure Managed Database for App Service.
Database: Burstable, B1s, 1 vCores, 1 GiB RAM, 20 GiB storage
App Service: Basic B1 1 Core 1.75 GiB RAM 10 GiB storage
The machine specs are not an issue, I've attempted to scale up both the DB and App Service to premium plans, and there was no noticeable performance difference. Besides, the previous cloud platform had a similar configuration, but the pages on the forum were loading >1s, so I'm pretty sure the issue is elsewhere
Database Performance
I first thought the database might not be performing well, so I ran a Sysbench test from the App Service, but it seems fine.
SQL statistics:
queries performed:
read: 104902
write: 29972
other: 14986
total: 149860
transactions: 7493 (124.83 per sec.)
queries: 149860 (2496.60 per sec.)
ignored errors: 0 (0.00 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 60.0232s
total number of events: 7493
Latency (ms):
min: 17.64
avg: 32.03
max: 501.91
95th percentile: 51.02
sum: 239998.10
Threads fairness:
events (avg/stddev): 1873.2500/21.44
execution time (avg/stddev): 59.9995/0.01
Extensions
I disabled all extensions except for tags and and the english language pack, and it did speed up a bit but not by much.
So I tried to set up a new forum from scratch, without migrating anything, on a new App Service and new DB, and I get the same issue (albeit a bit faster)
Here is the link to that forum: https://shfc-forum-app.azurewebsites.net
You can try posting something to see how long it takes and get an idea of what I mean.
Other info:
PHP Info: https://shfc-forum-app.azurewebsites.net/info.php
App Service:
Database:
Flarum Info:
Flarum core: 1.8.5
PHP version: 8.3.8
MySQL version: 8.0.36-cluster
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, standard, posix, random, readline, Reflection, Phar, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, sqlsrv, pdo_sqlsrv, bcmath, calendar, exif, gd, gettext, gmp, imap, intl, ldap, mongodb, mysqli, odbc, pcntl, pdo_mysql, PDO_ODBC, pdo_pgsql, pgsql, redis, shmop, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, tidy, xsl, zip, Zend OPcache
+----------------------+---------+--------+
| Flarum Extensions | | |
+----------------------+---------+--------+
| ID | Version | Commit |
+----------------------+---------+--------+
| flarum-flags | v1.8.0 | |
| flarum-approval | v1.8.1 | |
| flarum-tags | v1.8.0 | |
| flarum-suspend | v1.8.1 | |
| flarum-subscriptions | v1.8.0 | |
| flarum-sticky | v1.8.0 | |
| flarum-statistics | v1.8.0 | |
| flarum-mentions | v1.8.3 | |
| flarum-markdown | v1.8.0 | |
| flarum-lock | v1.8.0 | |
| flarum-likes | v1.8.0 | |
| flarum-lang-english | v1.8.0 | |
| flarum-emoji | v1.8.0 | |
| flarum-bbcode | v1.8.0 | |
+----------------------+---------+--------+
Base URL: https://shfc-forum-app.azurewebsites.net
Installation path: /home/site/wwwroot
Queue driver: sync
Session driver: file
Mail driver: mail
Debug mode: off