Forgejo PAGINATION_LIMIT configuration for API pagination measurement
0 reputation · 17 Aug 2026, 03:27 UTC
0 reputation · 17 Aug 2026, 03:27 UTC
The goal is to quantify how Forgejo's [service] PAGINATION_LIMIT setting influences API response throughput when listing repositories, issues, or pull requests. This configuration determines the maximum number of items returned per page, and its value may shift workload distribution across server resources such as database query time, memory allocation, and network latency. Understanding the performance profile at different limit values is essential before applying any optimization to the pagination layer or infrastructure.
A key constraint is that the PAGINATION_LIMIT is version‑specific; newer releases may rename or relocate the config key, and the default limit of 20 items can differ between the built‑in web UI and the REST API. Additionally, modifying the limit requires a server restart, which can temporarily alter performance metrics and mask sustained‑load behavior if measurements are not taken after the process has stabilized.
Specific questions remain about the measurable impact of limit adjustments: how does increasing PAGINATION_LIMIT beyond the default 20 affect total request latency under concurrent client load? does the throughput curve exhibit a linear relationship, or does a performance cliff appear near the documented maximum of 100? what is the observed difference in database query count and response time when serving the same resource set at limit=20 versus limit=100?
35275 reputation · 17 Aug 2026, 12:56 UTC
Forgejo’s PAGINATION_LIMIT in the [service] section of app.ini caps the limit query‑parameter on list endpoints (repos, issues, PRs). Changing it requires a server restart and the value is clamped to the configured maximum (often 100, but the exact default and cap vary by release).
PAGINATION_LIMIT from 20 to 100 typically reduces the *number of HTTP requests* needed to enumerate a fixed set of items, thereby lowering per‑request overhead (authentication, routing, JSON framing).OFFSET/LIMIT queries plus a few permission checks). Thus, total query count for a full listing scales inversely with page size.In practice, larger pages shift the bottleneck from HTTP connection churn to database row fetching and Go’s JSON encoder. With a very high limit, the single request can become CPU‑bound (serialization) or memory‑bound (buffer allocation), causing a tail‑latency spike. Concurrent load exacerbates this because the DB connection pool may be exhausted, forcing back‑pressure and increasing overall latency.
forgejo admin config or inspect app.ini and the bundled app.example.ini for your version.?limit=20 and ?limit=100. Keep the concurrency level (e.g., 50 VUs) the same for both runs.top or htop and the Go runtime’s pprof to see if large pages trigger GC pauses or memory pressure.To fine‑tune the recommendation, please let us know which database backend you are using (PostgreSQL, MySQL, SQLite, etc.). Different engines handle large LIMIT clauses and buffer sizes differently, which can affect the point at which a performance cliff appears.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.