Troubleshooting
Gor can report stats on the output-tcp
and output-http
request queues. Stats are reported to the console every 5 seconds in the form latest,mean,max,count,count/second
by using the --output-http-stats
and --output-tcp-stats
options.
Examples:
How can I tell if I have bottlenecks?
Key areas that sometimes experience bottlenecks are the output-tcp and output-http functions which have internal queues for requests. Each queue has an upper limit of 100. Enable stats reporting to see if any queues are experiencing bottleneck behavior.
Output HTTP bottlenecks
When running a Gor replay the output-http feature may bottleneck if:
the replay has inadequate bandwidth. If the replay is receiving or sending more messages than its network adapter can handle the output-http-stats may report that the output-http queue is filling up. See if there is a way to upgrade the replay's bandwidth.
with
--output-http-workers
set to anything other than-1
the-output-http
target is unable to respond to messages in a timely manner. The http output workers which take messages off the output-http queue, process the request, and ensure that the request did not result in an error may not be able to keep up with the number of incoming requests. If the replay is not using dynamic worker scaling (--output-http-workers=-1
) The optimal number of output-http-workers can be determined with the formulaoutput-workers = (Average number of requests per second)/(Average target response time per second)
.
Output TCP bottlenecks
When using the Gor listener the output-tcp feature may bottleneck if:
the replay is unable to accept and process more requests than the listener is able generate. Prior to troubleshooting the output-tcp bottleneck, ensure that the replay target is not experiencing any bottlenecks.
the replay target has inadequate bandwidth to handle all its incoming requests. If a replay target's incoming bandwidth is maxed out the output-tcp-stats may report that the output-tcp queue is filling up. See if there is a way to upgrade the replay's bandwidth.
Tuning
To achieve the top most performance you should tune the source server system limits:
Gor is crashing with following stacktrace
There is a chance that you hit Go bug. The crash comes from the CGO version of DNS resolver. By default Go based version used, but ins some cases it switches to CGO based. It is possible to force Go based DNS resolver using GODEBUG environment variable: sudo GODEBUG="netdns=go" ./gor --input-raw :80 --output-http staging.env
Also, see [[FAQ]]
Last updated