You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by xingjl6280 <xi...@163.com> on 2019/12/20 07:23:43 UTC

Slow startup with extra 30-40s after integrating ignite

hi team,

as a hazlecast user, I'm new to ignite .
After setting up my sample project, I found the startup gets slowed down
with 30-40s.
Seems the discovery took much time. I tries static IP and multicast, seems
no diff.

Is this expected or not?

Issue replication:
1. Run ignite 2.7.6 (win10, 32GB ram, SSD, intel i7)
bin\ignite.bat examples\config\example-ignite.xml

2. Create a java spring project with below dependencies
'org.apache.ignite:ignite-core:2.7.6'
'org.apache.ignite:ignite-spring:2.7.6'
'org.apache.ignite:ignite-spring-data:2.7.6'

3. Define a bean which could be autowired 

@Configuration
public class IgniteConfig implements Config {
    @Bean
    public Ignite igniteInstance() {
        IgniteConfiguration cfg = new IgniteConfiguration();
        cfg.setPeerClassLoadingEnabled(true);

//        TcpDiscoveryMulticastIpFinder tcpDiscoveryMulticastIpFinder=new
TcpDiscoveryMulticastIpFinder();
//       
tcpDiscoveryMulticastIpFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));
//        tcpDiscoveryMulticastIpFinder.setAddressRequestAttempts(1);

        TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new
TcpDiscoveryVmIpFinder();
       
tcpDiscoveryVmIpFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));


        TcpDiscoverySpi tcpDiscoverySpi=new TcpDiscoverySpi();
        tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);
        cfg.setDiscoverySpi(tcpDiscoverySpi);


        return Ignition.start(cfg);
    }
}



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Slow startup with extra 30-40s after integrating ignite

Posted by Denis Magda <dm...@apache.org>.
Have you tried to run the same project on a different machine? It takes a
couple of seconds to start any example from Ignite repo on mine.

Try this experiment. Use ExampleNodeStartup from Ignite examples [1] to
start a server node (feel free to switch to TcpIpFinder in the config used
by the examples). Measure. Then run any other example that will connect to
this server node. Measure. It takes a couple of seconds on my Mac. Should
not be that different on Windows.

[1]
https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples

-
Denis


On Sat, Dec 21, 2019 at 6:43 AM xingjl6280 <xi...@163.com> wrote:

> thanks for the reply.
>
> that's what i tried, with a range of port or specified one port only
>
> tcpDiscoveryMulticastIpFinder.setAddresses(Collections.singletonList("
> 127.0.0.1:47500"));
>
> i also tried given one static ip
> tcpDiscoveryVmIpFinder.setAddresses(Collections.singletonList("
> 127.0.0.1:47500"));
>
> but why the discovery still need 40 seconds,
>
> please kindly advise.
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Slow startup with extra 30-40s after integrating ignite

Posted by xingjl6280 <xi...@163.com>.
that's it ! 

By setting setLocalHost("127.0.0.1"), the Ignition.start statement takes 4-6
seconds now, 
comparing to 22 seconds previously. 

Many thanks. 

Still can't understand the discovery mechnism, I think specifying one 
static IP should work in same way. 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Slow startup with extra 30-40s after integrating ignite

Posted by xingjl6280 <xi...@163.com>.
that's it !

The setting works, the Ignition.start statement takes 4-6 seconds now,
comparing 22 seconds previously.

Many thanks.

Still can't understand the discovery mechnism, I thought by specifying one
static IP should work in same way.





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Slow startup with extra 30-40s after integrating ignite

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

I've heard that setLocalHost("127.0.0.1") sometimes helps in this situation
- Ignite does not have to traverse all network adapters.

Regards,
-- 
Ilya Kasnacheev


сб, 21 дек. 2019 г. в 17:43, xingjl6280 <xi...@163.com>:

> thanks for the reply.
>
> that's what i tried, with a range of port or specified one port only
>
> tcpDiscoveryMulticastIpFinder.setAddresses(Collections.singletonList("
> 127.0.0.1:47500"));
>
> i also tried given one static ip
> tcpDiscoveryVmIpFinder.setAddresses(Collections.singletonList("
> 127.0.0.1:47500"));
>
> but why the discovery still need 40 seconds,
>
> please kindly advise.
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Slow startup with extra 30-40s after integrating ignite

Posted by xingjl6280 <xi...@163.com>.
thanks for the reply.

that's what i tried, with a range of port or specified one port only

tcpDiscoveryMulticastIpFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));

i also tried given one static ip
tcpDiscoveryVmIpFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));

but why the discovery still need 40 seconds, 

please kindly advise. 




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Slow startup with extra 30-40s after integrating ignite

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

On Windows, it is recommended to get rid of multicast and decrease port
range, such as 127.0.0.1:47500..47502 <http://127.0.0.1:47500>

Regards,
-- 
Ilya Kasnacheev


пт, 20 дек. 2019 г. в 10:23, xingjl6280 <xi...@163.com>:

> hi team,
>
> as a hazlecast user, I'm new to ignite .
> After setting up my sample project, I found the startup gets slowed down
> with 30-40s.
> Seems the discovery took much time. I tries static IP and multicast, seems
> no diff.
>
> Is this expected or not?
>
> Issue replication:
> 1. Run ignite 2.7.6 (win10, 32GB ram, SSD, intel i7)
> bin\ignite.bat examples\config\example-ignite.xml
>
> 2. Create a java spring project with below dependencies
> 'org.apache.ignite:ignite-core:2.7.6'
> 'org.apache.ignite:ignite-spring:2.7.6'
> 'org.apache.ignite:ignite-spring-data:2.7.6'
>
> 3. Define a bean which could be autowired
>
> @Configuration
> public class IgniteConfig implements Config {
>     @Bean
>     public Ignite igniteInstance() {
>         IgniteConfiguration cfg = new IgniteConfiguration();
>         cfg.setPeerClassLoadingEnabled(true);
>
> //        TcpDiscoveryMulticastIpFinder tcpDiscoveryMulticastIpFinder=new
> TcpDiscoveryMulticastIpFinder();
> //
> tcpDiscoveryMulticastIpFinder.setAddresses(Collections.singletonList("
> 127.0.0.1:47500"));
> //        tcpDiscoveryMulticastIpFinder.setAddressRequestAttempts(1);
>
>         TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new
> TcpDiscoveryVmIpFinder();
>
> tcpDiscoveryVmIpFinder.setAddresses(Collections.singletonList("
> 127.0.0.1:47500"));
>
>
>         TcpDiscoverySpi tcpDiscoverySpi=new TcpDiscoverySpi();
>         tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);
>         cfg.setDiscoverySpi(tcpDiscoverySpi);
>
>
>         return Ignition.start(cfg);
>     }
> }
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>