Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hazelcast in spring boot app performance issue #6052

Closed
krishnakumarp opened this issue Aug 25, 2015 · 1 comment
Closed

Hazelcast in spring boot app performance issue #6052

krishnakumarp opened this issue Aug 25, 2015 · 1 comment

Comments

@krishnakumarp
Copy link

Hi,

I am using version 3.5.1

Even when the app is not doing anything, cpu consumption is very high. After profiling with Yourkit, most of the cpu (upto 70%) is consumed by thread named ".hazelcast-wm.esnureInstance"
This method seems to be using maximum cpu.

com.hazelcast.web.ClusteredSessionService$1.run() ClusteredSessionService.java

Any clues on how to reduce the cpu usage?

Thanks,
Krishna

The instance is configured using the following code.

    @Bean
    public HazelcastInstance hazelcastInstance() {
        log.debug("Configuring Hazelcast");
        Config config = new Config();
        config.setInstanceName("instanceName");
        config.getNetworkConfig().setPort(5701);
        config.getNetworkConfig().setPortAutoIncrement(true);

        if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) {
            System.setProperty("hazelcast.local.localAddress", "127.0.0.1");

            config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(false);
            config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
            config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
        }

        config.getMapConfigs().put("default", initializeDefaultMapConfig());
        config.getMapConfigs().put("com.company.app.domain.*", initializeDomainMapConfig());
        config.getMapConfigs().put("my-sessions", initializeClusteredSession());

        hazelcastInstance = HazelcastInstanceFactory.newHazelcastInstance(config);

        return hazelcastInstance;
    }

    private MapConfig initializeDefaultMapConfig() {
        MapConfig mapConfig = new MapConfig();
        mapConfig.setBackupCount(0);
        mapConfig.setEvictionPolicy(EvictionPolicy.LRU);
        mapConfig.setMaxSizeConfig(new MaxSizeConfig(0, MaxSizeConfig.MaxSizePolicy.USED_HEAP_SIZE));
        mapConfig.setEvictionPercentage(25);
        return mapConfig;
    }
@mesutcelik
Copy link

This is already fixed in 3.5.2(#5834). Can you please try latest snapshot or wait for 3.5.2 release? 3.5.2 will be released soon...

@ahmetmircik ahmetmircik added this to the 3.5.2 milestone Aug 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants