Skip to content

Commit 91f1c28

Browse files
authored
Improve pprof doc (#20463)
1 parent 3310dd1 commit 91f1c28

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

cmd/web.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ func runWeb(ctx *cli.Context) error {
148148
go func() {
149149
http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler())
150150
_, _, finished := process.GetManager().AddTypedContext(context.Background(), "Web: PProf Server", process.SystemProcessType, true)
151+
// The pprof server is for debug purpose only, it shouldn't be exposed on public network. At the moment it's not worth to introduce a configurable option for it.
151152
log.Info("Starting pprof server on localhost:6060")
152-
log.Info("%v", http.ListenAndServe("localhost:6060", nil))
153+
log.Info("Stopped pprof server: %v", http.ListenAndServe("localhost:6060", nil))
153154
finished()
154155
}()
155156
}

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
300300
- `APP_DATA_PATH`: **data** (**/data/gitea** on docker): Default path for application data.
301301
- `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars. Note that this cache is disabled when `RUN_MODE` is "dev".
302302
- `ENABLE_GZIP`: **false**: Enable gzip compression for runtime-generated content, static resources excluded.
303-
- `ENABLE_PPROF`: **false**: Application profiling (memory and cpu). For "web" command it listens on localhost:6060. For "serv" command it dumps to disk at `PPROF_DATA_PATH` as `(cpuprofile|memprofile)_<username>_<temporary id>`
303+
- `ENABLE_PPROF`: **false**: Application profiling (memory and cpu). For "web" command it listens on `localhost:6060`. For "serv" command it dumps to disk at `PPROF_DATA_PATH` as `(cpuprofile|memprofile)_<username>_<temporary id>`
304304
- `PPROF_DATA_PATH`: **data/tmp/pprof**: `PPROF_DATA_PATH`, use an absolute path when you start Gitea as service
305305
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login, **custom**\]. Where custom would instead be any URL such as "/org/repo" or even `https://anotherwebsite.com`
306306
- `LFS_START_SERVER`: **false**: Enables Git LFS support.

docs/content/doc/help/seek-help.en-us.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ menu:
4444
* This will greatly improve the chance that the root of the issue can be quickly discovered and resolved.
4545
5. If you meet slow/hanging/deadlock problems, please report the stack trace when the problem occurs:
4646
1. Enable pprof in `app.ini` and restart Gitea
47-
```
47+
```ini
4848
[server]
4949
ENABLE_PPROF = true
5050
```
51-
2. Trigger the bug, when Gitea gets stuck, use curl or browser to visit: `http://127.0.0.1:6060/debug/pprof/goroutine?debug=1` (IP is `127.0.0.1` and port is `6060`)
52-
3. Report the output (the stack trace doesn't contain sensitive data)
51+
2. Trigger the bug, when Gitea gets stuck, use curl or browser to visit: `http://127.0.0.1:6060/debug/pprof/goroutine?debug=1` (IP must be `127.0.0.1` and port must be `6060`).
52+
3. If you are using Docker, please use `docker exec -it <container-name> curl "http://127.0.0.1:6060/debug/pprof/goroutine?debug=1"`.
53+
4. Report the output (the stack trace doesn't contain sensitive data)
5354
5455
## Bugs
5556

0 commit comments

Comments
 (0)