A jetty server is configured using a queuedthreadpool with 10 threads.
QueuedThreadPool threadPool = new QueuedThreadPool(
10,
10,
60000,
new LinkedBlockingQueue<>(1000)
);
}
threadPool.setDaemon(true);
final Server server = new Server(threadPool);
To this jetty server, I'm attaching a RequestLog based handler so that every request is logged:
RequestLogHandler requestLogHandler = new RequestLogHandler();
requestLogHandler.setRequestLog(new JettyRequestLog());
JettyRequestLog class:
public class JettyRequestLog implements RequestLog
{
private static final Logger logger = new Logger("org.test.jetty.RequestLog");
@Override
public void log(Request request, Response response)
{
if (logger.isDebugEnabled()) {
logger.debug(
"%s %s %s %s %d",
request.getRemoteAddr(),
request.getMethod(),
request.getHttpURI().toString(),
request.getProtocol(),
response.getStatus()
);
}
}
}
When does the request log handler log the request? Is it when the request is added to the queuedthreadpool or when it is dequeued from the pool? When the server gets hit with say 500 requests, the time waiting could be significant and I'm trying to identify if that is the case here.