forked from facebook/hhvm
/
debug.server
27 lines (18 loc) · 1.03 KB
/
debug.server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<h2>How to Debug Server Problems</h2>
1. Crashing and other memory problems
Normally a crash generates /tmp/stacktrace.<pid>.log file that has stacktrace
where crash happens. Sometimes, a crash can happen badly without giving crash
log a chance to generate a readable stack. Then use ResourceLimit.CoreFileSize
to turn on coredumps to capture a crash.
Another way is to use Debug.RecordInput option to capture bad HTTP requests.
Debug.RecordInput = true
Debug.ClearInputOnSuccess = false
Then replay with "-m replay" option from the compiled program at command line.
This way, one can run it under valgrind to detect memory problems.
./program -m replay -c config.hdf --count=3 /tmp/hphp_request_captured
./program -m replay -c config.hdf captured_request1 captured_request2
./program -m replay -c config.hdf --count=2 req1 req2
2. Server hanging and other status problems
Admin server commands provide status information that may be useful for
debugging, esp. /status.json command that will tell network I/O status of each
thread.