carbon-kernel icon indicating copy to clipboard operation
carbon-kernel copied to clipboard

Servers hang for one minute during startup

Open tharikaGitHub opened this issue 4 years ago • 0 comments

Description: In the server startup we observed an excessive usage of getConnectionId() method [1] and in other publisher/store functions. With our current implementation of the method, connectionId has been constructed as follows.

connectionId = (connectionMetaData.getUserName() != null ? connectionMetaData.getUserName().split("@")[0] : connectionMetaData.getUserName()) + "@" + connectionMetaData.getURL();

connectionMetaData.getUserName() is executing internal DB queries to get the User name from the database continuously, which causes the performance impact with some of the environment conditions (eg: slow network). As we analyzed this has caused the slowness in the server startup and other functionalities in all the environments.

[1] https://github.com/wso2/carbon-kernel/blob/abc856b0845acaad29cfc9edac2d50a58dd7bec6/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/utils/RegistryUtils.java#L196

tharikaGitHub avatar Jun 04 '20 05:06 tharikaGitHub