flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.24k stars 828 forks source link

fttb slow response time #3952

Open UserZHTW opened 6 months ago

UserZHTW commented 6 months ago

Current Behavior

I found a bug where the fttb (first time to byte) time would exceed 2 seconds when my notification count reached 10000+. However, if I cleared all notifications, the fttb time would return to 500ms.

Steps to Reproduce

Number of account notifications 5000+

Expected Behavior

Slow initial server response time

Screenshots

294571602-8f9e10d0-070b-48f7-9d42-ff01e45560d7

Environment

Flarum version: 1.8.3 Webserver: nginx Hosting environment: dedicated server (64GB RAM , 6c/12t) PHP version: 8.1.2 Browser: Chrome

Output of php flarum info

+--------------------------------+----------+--------+
| Flarum Extensions              |          |        |
+--------------------------------+----------+--------+
| ID                             | Version  | Commit |
+--------------------------------+----------+--------+
| flarum-flags                   | v1.8.0   |        |
| flarum-approval                | v1.8.1   |        |
| flarum-tags                    | v1.8.0   |        |
| kater-lang-traditional-chinese | dev-main |        |
| flarum-suspend                 | v1.8.1   |        |
| flarum-subscriptions           | v1.8.0   |        |
| flarum-sticky                  | v1.8.0   |        |
| flarum-statistics              | v1.8.0   |        |
| flarum-nicknames               | v1.8.0   |        |
| flarum-mentions                | v1.8.2   |        |
| flarum-markdown                | v1.8.0   |        |
| flarum-lock                    | v1.8.0   |        |
| flarum-lang-english            | v1.8.0   |        |
| flarum-emoji                   | v1.8.0   |        |
| flarum-bbcode                  | v1.8.0   |        |
+--------------------------------+----------+--------+

Possible Solution

Clear redundant notifications if there are more than 1000 notifications or limit the number of notifications displayed to 999+?

Additional Context

This problem still exists

https://github.com/flarum/framework/issues/3778