RAM usage, the Problems README, Recovery, Repairs, Rules Report, Security Report, Snap, Speed, Summary and Tests now open with what the feature is, links to read more, step-by-step use, how each number is computed and how it is implemented, and end with the commits that built it. Corrected from the code: the automatic board repair no longer un-binds lists (since #6515); Recovery's rule email section has Review, Resend, Mark as sent and Drop, and a section for legacy rule emails; Delete is under Settings; the Product name is in Settings / Appearance; Speed rows fold per kind of request, not per path; the RAM row detail has WeKan RSS and no load; the snap command falls back to MONGO_URL and prints the Databases section. Thanks to xet7 !
6.8 KiB
Admin Panel / Problems / Speed
What it is
The Speed pane lists the HTTP requests that took too long to answer. WeKan
times every request that is not a static file, and when one takes at least two
seconds (by default) it records it here, so an administrator can see which
pages or REST API calls are slow and how often. Address:
/admin/problems/speed. Site administrators only.
Read more
- Response time on Wikipedia - what the timed duration is.
- Application performance management on Wikipedia - the wider practice this pane is a small part of.
- In WeKan: Performance (how boards load their cards), Large-Boards.md, Instrumentation (DDP method and publication timings), CPU usage, Design.md.
How to use it
Read the slow requests
- Log in as a site administrator.
- Click your avatar or username at the top right and choose Admin Panel.
- Click the Problems tab.
- In the left menu, under Reports, click Speed.
- Read the table, newest first. The Detail column says which request it was
and how long it took, for example
GET /b/abc/my-board — 5120ms >= 2000ms. - Type part of a path, a username or an address in the search box to filter the rows as you type.
Acknowledge or clear the stream
- Open Problems → Summary.
- Tick Admin Panel → Problems → Speed.
- Click Acknowledge or Clear (Summary.md).
Change or turn off the threshold
- Set
WEKAN_SLOW_REQUEST_MSto the number of milliseconds a request may take before it is recorded, or to0to turn the detector off. - Restart WeKan.
How the numbers are calculated
From server/lib/speedMiddleware.js:
| Number | How it is computed |
|---|---|
Duration (<ms>ms) |
Date.now() when the request arrives, subtracted from Date.now() when the response's finish event fires. |
| Threshold | WEKAN_SLOW_REQUEST_MS, default 2000; 0 (or any value that is not above 0) turns the detector off. |
| Severity | medium when the duration is at least three times the threshold (6000 ms by default), otherwise low. |
| Attempts | how many slow requests were folded into this row (count); empty when it happened once. |
| New-problem count on Summary | rows newer than the last acknowledgement whose severity is not info. |
| Rows per page | 10 (TABLE_PAGE_ROWS_PER_PAGE). |
| Retention | rows older than EVENTLOG_RETENTION_DAYS (default 90) are deleted once a day. |
Folding: a row's identity is its stream, name, category, action, source, severity and CWE (models/lib/eventLogSummary.js), not its path. So every slow request of the same severity is folded into the same row, whose count and date go up, and the Detail column shows the most recent request. (An earlier version of this page said rows were folded per request path; the detail text is not part of the identity.)
How it works in WeKan
Where the rows come from
The speed stream of the eventlog collection. Today one detector writes it:
server/lib/speedMiddleware.js times every HTTP request that is not a static
asset (.js, .css, .png, .jpg/.jpeg, .gif, .svg, .woff/.woff2,
.ico, .map, .webp, .avif) or under /cdn/, and when one takes at least
WEKAN_SLOW_REQUEST_MS milliseconds (default 2000; 0 turns the detector off)
it records, through server/lib/speedLog.js:
- category
slow-request, nameSlowRequest, actiondetected, sourcehttp; - severity
low, ormediumwhen it took three times the threshold or more; - detail
<METHOD> <path> — <ms>ms >= <threshold>ms, without the query string.
Rows stored under the old name SlowBleed are renamed to SlowRequest at
startup. Timing never breaks a request: any error in the middleware is
swallowed.
DDP methods and publications are not timed here; their live call counts and durations are on Instrumentation. The CPU monitor writes its own stream, shown on CPU usage.
The same kind of slow request that happens again is folded into the same row, whose count and date go up (Design.md).
The table
The same read-only event table as the Security Report:
Date and time, Category, Name, Severity, Action, Source, Username, IPv4,
Location, IPv6, Location, Attempts and Detail, newest first, 10 rows a page,
with a search box that filters as you type. It shows "No new problems." when the
stream is empty. The rows come from the admin-only eventLogCount and
eventLogPage methods in models/eventLog.js.
Acknowledge or clear the stream on Summary. Rows older than
EVENTLOG_RETENTION_DAYS (default 90) are deleted daily. The rows are also on
GET /api/admin/problems/speed
(REST API).
Tests
- tests/securityLog.test.cjs - the loggers behind the security, speed and tests streams, including the slow-request middleware.
- tests/eventLogSummary.test.cjs - folding into one row per problem.
- tests/resourceStreamNames.test.cjs -
the
SlowRequestname. - tests/eventLogClearAndRetention.test.cjs - Clear and the 90-day retention.
Related
- Performance - how boards load their cards.
- Large-Boards.md
Commits
- Name the rows SlowRequest instead of SlowBleed
- Clear button and 90-day retention for the problem streams
- Show the origin context (address, location) in every event report
- One summary row per problem, with who and how often
- Record slow HTTP requests to the Speed stream
- Store the security, speed and tests streams in the WeKan database
- First security and speed loggers
- Add the Problems page with its Speed pane