JDK-4281556 : Very Slow plugin performance even with ip address connects
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.2.2
  • Priority: P1
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 1999-10-15
  • Updated: 2013-11-01
  • Resolved: 1999-11-09
Related Reports
Relates :  
Description
Customer using Java Plugin for Windows 1.2.2 and from the applet,
accessing a servlet (entire sample code is attached). Plugin 1.1.x does
not have this problem.

Java plugin performance is very slow when you open a URL connection (or 
a socket) back to the host from which applet came. With snoop, we can find 
that plugin is trying to make name resolution queries. 

But since IP addresses are used everywhere, there should no need for
plugin to lookup the name. For a demonstration, please visit following
URL.
http://203.116.231.10:4048/httptest_desmond/testhttp1.html

(You will have to grant socket permissions to above host).

You will see that at the point of opening the http connection in server (code
is attached in attachments) the applet freezes. It resumes after approx. 5 
seconds as seen from snoop traces.

Also, if you put an entry in the 'hosts' file on the window machine such as
203.116.231.10 	any-junk.Junk.COM
the performance is dramatically improved. Note that the hostname in the above
entry does not have to be correct, any dummy name will do. Therefore there
is reason to believe that plugin is doing an unnecessary name resolution and
that is degrading the performance to unacceptable level.

In the intranet, the problem is easy to reproduce if you have DNS turned OFF.
On the internet however the problem comes up with DNS on also.

Comments
EVALUATION This is looking like java.net classes problem to me. jerome.dochez@Eng 1999-11-03 ------------------------------------------------------- The problem can be reproduced on the PC which uses static IP address, not on DHCP. The reason is that everytime the applet looks up a servlet, it needs to go through DNS search so that it requires the security checking. The security checking takes time. To avoid the security checking, you can grant all permissions in the policy file. After granting all permissions, the performance in plugin1.2.X is same to Plugin1.1.X. natalie.wang@eng 1999-11-03
03-11-1999

WORK AROUND Put the ip address in the 'hosts' file on the client. But this is unacceptable workaround as the clients can be anywhere on the internet and we cannot edit the 'hosts' file for them. -------------------------------------------------------------------------------- The problem can be reproduced on the PC which uses static IP address, not on DHCP. The reason is that everytime the applet looks up a servlet, it needs to go through DNS search so that it requires the security checking. The security checking takes time. To avoid the security checking, you can grant all permissions in the policy file. After granting all permissions, the performance in plugin1.2.X is same to Plugin1.1.X. natalie.wang@eng 1999-11-03
03-11-1999