Info on message flags:
http://www.jgroups.org/manual4/index.html#MessageFlags
I've run tests with minimal protocol stacks before and removing
protocols such as UNICAST3 or NAKACK2 made almost no difference.
A much bigger performance increase could be had by
- Sizing the thread pool correctly
- Using OOB RPCs/messages
- Handling MessageBatches at the application level
(Receiver.receive(MessageBatch)
- Using async invocations [1] etc
[1]
http://www.jgroups.org/manual4/index.html#AsyncInvocation
On 16.11.18 14:46, Gautam Saxena wrote:
> I'm a newbie to Jgroups, but based on my understanding of the
> documentation, one of its key advantages is that one can disable the
> protocol elements one does not need/want (to achieve better
> performance). However, when I tried to disable anything that had to do
> with "FIFO" order of delivery and "guaranteeing delievery", I got the
> following error:
>
> |
> Exceptioninthread "main"java.lang.Exception:events [GET_DIGEST
> SET_DIGEST ]are required byGMS,but notprovided byany of the protocols
> below it
> at org.jgroups.stack.Configurator.sanityCheck(Configurator.java:320)
> at
> org.jgroups.stack.Configurator.connectProtocols(Configurator.java:197)
> at
> org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:115)
> at
> org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:49)
> at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:475)
> at org.jgroups.JChannel.init(JChannel.java:965)
> at org.jgroups.JChannel.<init>(JChannel.java:148)
> at org.jgroups.JChannel.<init>(JChannel.java:130)
> at RpcDispatcherTest.start(RpcDispatcherTest.java:29)
> at RpcDispatcherTest.main(RpcDispatcherTest.java:83)
> |
>
>
> My xml config file looks like this:
>
> |
> <configxmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
> <TCPbind_addr="127.0.0.1"
> bind_port="7800"
> recv_buf_size="${tcp.recv_buf_size:130k}"
> send_buf_size="${tcp.send_buf_size:130k}"
> max_bundle_size="64K"
> sock_conn_timeout="300"
> enable_diagnostics="true"
> thread_pool.min_threads="10"
> thread_pool.max_threads="20"
> thread_pool.keep_alive_time="30000"
> stats="false"
> />
> <TCPPINGinitial_hosts="127.0.0.1[7800]"
> port_range="0"stats="false"/>
> <MERGE3min_interval="10000"
> max_interval="30000"stats="false"/>
> <FD_SOCKstats="false"/>
> <FDtimeout="3000"max_tries="3"stats="false"/>
> <VERIFY_SUSPECTtimeout="1500"stats="false"/>
>
> <pbcast.GMSprint_local_addr="true"join_timeout="2000"
> view_bundling="true"stats="false"/>
> </config>
> |
>
>
> If I comment out the last protocol (the pgcast.GMS one), I do NOT get
> errors and it "seems" to work on a single windows VM (on Google Cloud),
> but if I start up a 2nd jvm (still on the same Windows machine), then I
> notice that each jvm is in a "separate" cluster and doesn't see the
> other. (In the "normal tcp.xml" config (which includes the NACKA and
> XXXX protocols), eg
>
> |
> <pbcast.NAKACK2use_mcast_xmit="false"
> discard_delivered_msgs="true"
> stats="false"/>
> <UNICAST3stats="false"/>
> <!--<pbcast.STABLE desired_avg_gossip="50000"-->
> <!--max_bytes="4M"/>-->
> |
>
>
> everything works "as expected", ie if I start a 2nd JVM on the same
> windows machine, the 2nd JVM does appear to join the 1st JVM's cluster
> and so messages sent on the 2nd JVM appear in the 1st JVM and vice-versa.
>
> So, is there a way to disable UNICAST3 and NAKACK2 (essentially,
> anything that has to do with FIFO ordering or guaranteeing message
> delivery) but still include the logic needed to ensure a "working
> complete cluster" that also captures which nodes leave/join the cluster
> (eg pbcast.GMS logic?) I couldn't figure out how....
>
> (Background info: I'm trying to improve performance, and I suspect the
> somewhat slow performance is because of the "guaranteed message
> delivery" and "FIFO" protocols, which I do not think I need because a)
> I'm using TCP and b) the messages can be sent in any order. (That said,
> I'm assuming that TCP, almost by definition, does the guaranteeing of
> message delivery, since that's critical.) I'm also on Google Cloud,
> where I think the "guaranteeing" aspect of TCP logic runs on highly
> optimized routers and Multicast is not allowed anyways, which supresses
> one of the main advantages of UDP multicast.)
>
> Finally (and I do *NOT* think this is needed), but here's my test code
> (which is just a slight modification of the demo that comes with JGroups
> 4.0):
>
> |
> importorg.jgroups.Address;
> importorg.jgroups.JChannel;
> importorg.jgroups.Message;
> importorg.jgroups.blocks.*;
> importorg.jgroups.util.RspList;
> importorg.jgroups.util.Util;
>
> importjava.util.concurrent.CompletableFuture;
> importjava.util.concurrent.atomic.AtomicInteger;
> importjava.util.stream.IntStream;
>
> publicclassRpcDispatcherTest{
> JChannelchannel;
> RpcDispatcherdisp;
> RspListrsp_list;
> String props ="gs-tcp.xml";// set by application
>
> e.printStackTrace();
> }
> });
>
> // Util.close(disp, channel);
> }
>