Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noticing odd performance issues under very light load #327

Open
daniel-elsner opened this issue Apr 22, 2017 · 0 comments
Open

Noticing odd performance issues under very light load #327

daniel-elsner opened this issue Apr 22, 2017 · 0 comments

Comments

@daniel-elsner
Copy link

While testing a small Zuul setup to prep for an eventual production release I've been noticing some odd things in regards to call timeouts and in general very slow response times. The main concern is what appears to be calls processing in what looks to be a serial manner. A simple view of a console network tab will show requests being responded to roughly the order they were dispatched one at a time.

Below are some settings that looked like an issue, but adjusting them hasn't resolved the issue.

cm.setMaxTotal(Integer.parseInt(System.getProperty("zuul.max.host.connections", "1000"))); cm.setDefaultMaxPerRoute(Integer.parseInt(System.getProperty("zuul.max.host.connections", "100")));

In the process of looking into this we've stripped away as much code as possible to get to a bare bones filter which does nothing but return a 206 after a 1 second delay when being hit with a request.

When 25 requests are made to this filter it's taking roughly 10 seconds for all the responses come back. With the 1 second timeout and no other code being executed, one would expect maybe 1.5-3 seconds for all calls to be resolved. Logs/network monitoring very clearly shows these requests being processed in a roughly serial manner as one after another are handled in order of being received.

` String FilterUrl = "/test/";

boolean shouldFilter() {
	HttpServletRequest request = RequestContext.getCurrentContext().getRequest();
	String uri = request.getRequestURI()
	if (RequestContext.getCurrentContext().requestURI != null) {
		uri = RequestContext.getCurrentContext().requestURI
	}
	if (uri.contains(FilterUrl) ){
		return true;
	}else{
		return false;
	}
	
}



Object run() {
	

	HttpResponse response;
	HttpResponseFactory factory = new DefaultHttpResponseFactory();
	response = factory.newHttpResponse(new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, null), null);
	
	Exception finallyException;

	TimeUnit.SECONDS.sleep(1);
	
	response.setEntity(new StringEntity('Test Return', ContentType.create("application/json")))
	setResponse(response, 206)
	
	
	return null
}`

This is the main code present in the filter. I realize this is rather vague, but are there areas in specific we should be looking to address this issue? Under even minor traffic the current setup we have does not seem at all production ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants