[
https://issues.jboss.org/browse/JBAS-9472?page=com.atlassian.jira.plugin....
]
Remy Maucherat resolved JBAS-9472.
----------------------------------
Resolution: Rejected
Unfortunately, I won't accept the patch, as I think the current JBoss code (from 7) is
vastly cleaner than what Tomcat is doing. Handling a large number of parameters is a
resources issue anyway, and is now quite restricted by default, thus resolving the
security issue.
I know some optimizations are possible (in particular because the JDK is super broken -
performance degrades with the size on the byte array, and the parsing code will be slow as
well), but this should be restricted to the Parameters class, and shouldn't change its
structure (it should not switch back to using a hashmap or arraylists). I delayed those
optimizations because of the regression risk, but you can work on some of them in trunk.
Thanks.
Improve the processing time of a request with a large number of
parameters.
---------------------------------------------------------------------------
Key: JBAS-9472
URL:
https://issues.jboss.org/browse/JBAS-9472
Project: Application Server 3 4 5 and 6
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Components: Web (Tomcat) service
Affects Versions: JBossAS-5.1.0.GA
Environment: Linux, Windows
Reporter: Toshio Oya
Assignee: Remy Maucherat
Attachments: modified-5.1.0.GA.zip, sample-app.zip
We ported an existing business application from Tomcat 5.5.x to JBoss AS 5.1.0.GA.
When running the application on JBoss AS, we found that the processing of a POST request
with a large number of parameters takes longer than doing it on Tomcat.
We investigated the cause, it occurred in the processing of
org.apache.tomcat.util.http.Parameters class in JBossAS/JBossWeb.
So, we've created a patch for JBoss AS to improve it.
We applied this patch to JBoss AS, then the processing time of 10,000 parameters in a
POST request is now as follows.
- Time of processing request.getParameterMap().
Before:
22,635.0 msec (average of 3 times)
After:
2.3 msec (average of 3 times)
We want to incorporate this patch in JBoss AS.
Using our sample application:
1. Build
$ cd /tmp
$ unzip sample-app.zip
$ cd sample-app
$ mvn package
2. Deploy
Please copy the test_war-1.0.war to your deploy directory for your JBossAS.
$ cd blank_war/target/
$ cp test_war-1.0.war $JBOSS_HOME/server/<profile>/deploy
3. Test
Access the url -
http://server:port/test_war-1.0/ via a web browser.
Press the "click" button in the page.
And, press "OK" button on a dialog.
The time of processing request.getParameters() is logged to CONSOLE and
log/server.log.
ex)
13:42:43,084 FATAL [SampleTestAction] request.getParameterMap() taken 20467 msec.
About patch.
modified-5.1.0.GA.zip
- B2CConverter.java ... replacement of org.apache.tomcat.util.buf.B2BConverter
- Parameters.java ... replacement of org.apache.tomcat.util.http.Parameters
- LocalStrings.properties
... added a new property file to org.apache.tomcat.util.http.
Best regards,
Team.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira