Slow Request

Problem

In a web application very slow requests with up to 30 seconds run time has been measured. The MySQL log file does not show any depending slow query, so the problem must be searched in GlassFish or in the application.

Synchronized

With special logging the reason for the bad performance could be found in an class with compiled regular expression pattern, which was used as blacklist filter for all user.

The object was saved on application scope level and the method for checking inputs was defined with synchronized. This bug causes that all following requests must wait, until the check of the current request has completly finished.

Slow Client

Despite of the bugfixing the logs still show up to thousand requests per day with long run time. Strangely enough this occured on the first call of HttpServletRequest.getParameter.

A discussion with Jean-Francois Arcand of Sun adduced, that the long run time come from slow clients or network connections. GlassFish tries to read the requested data, but these have not been send or have been send to slowly from the client.

Advanced logging shows, that the slow requests occur mainly with WAP clients and on POST requests. Seemingly the POST parameter will be send on explicit request.

Solution

The problem with slow clients or network connections can naturally not be solved by GlassFish. Only to do is to increase the request queue size in HTTP Service, to ensure that pooled requests will not expire/reject.

Max Pending Count: 8192

Resources

[1] GlassFish V2

Johannes Hammoud Slow Request 06.07.2008

I Coding : Community about Java programing

Language German+-

Java JSF JavaScript HTML CSS NetBeans GlassFish MySQL

Imprint

Visits
5744577
Today
146