Symptoms
RMI access to the CRX repository has been enabled by setting rmi-port to 1234 in crx-author/web.xml. The response time is extremely slow; it takes 74 seconds to JNDI lookup the JCR RemoteRepository.
Cause
The RMI port specified in the server configuration is just the port of the RMI registry where the remote reference is stored. The actual RMI service uses another port that is currently not configurable; it's selected randomly by the operating system.
It is however possible to also access the actual RMI service using HTTP requests to the configured RMI port. This is the default fallback that Java uses if the real service port can not be accessed. Such poor performance can be caused when the HTTP fallback is being used.
Resolution
There is no alternative remote access layer and it seems that the HTTP tunneling workaround isn't fast enough. Thus the only reasonable alternative would be to use the operating system's ability to set the range of dynamic ports that the operating system can assign to the RMI service. On Linux this is achieved by modifying the contents of /proc/sys/net/ipv4/ip_local_port_range. That should allow accessing the repository more efficiently using the native RMI protocol.
Applies to
CRX