Apache Ignite Queue much slower compared to LinkedBlockingQueue
I'm trying to replicate a simple producer-consumer scenario in Ignite:
public class QueueExample {
public static void main(String args) {
new QueueExample().start();
}
private void start() {
final AtomicBoolean finishedTest1 = new AtomicBoolean(false);
final BlockingQueue<Double> queue = new LinkedBlockingQueue<>(5);
final CountDownLatch latch = new CountDownLatch(2);
final int MAX = 1000;
new Thread(() -> {
System.out.println("test1 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < MAX; i++) {
try {
queue.put(r.nextDouble());
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
sw.stop();
finishedTest1.set(true);
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test1. " + test + ", took:" + sw.getTime() / 1000f);
}).start();
new Thread(() -> {
System.out.println("test2 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < MAX ; i++) {
Double res = queue.poll(1, TimeUnit.SECONDS);
counter++;
}
} catch (InterruptedException e) {
// expected
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test2. counter " + counter + ", finished:" + finishedTest1.get() + ", took:" + sw.getTime() / 1000f);
}).start();
}
}
Why is this 100 times faster (0.02sec vs. <2sec) compared to the following Ignite code?
public class MyIgnite {
public static void main(String args) {
new MyIgnite().start();
}
private void start() {
IgniteConfiguration icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test1");
Ignite ignite1 = Ignition.start(icfg);
final CountDownLatch latch = new CountDownLatch(2);
final int queueSize = 5;
CollectionConfiguration queueCfg = new CollectionConfiguration();
ignite1.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test1 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000; i++) {
queue.put(r.nextDouble());
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test1. " + test + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("starting test2");
icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test2");
Ignite ignite2 = Ignition.start(icfg);
ignite2.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test2 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < 1000; i++) {
Double res = queue.poll(5, TimeUnit.SECONDS);
counter++;
}
} catch (IgniteException exc) {
System.out.println("Somehow cannot poll. " + exc);
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test2. counter " + counter + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("oldest node: " + ignite1.cluster().forOldest().hostNames());
System.out.println("nodes: " + ignite1.cluster().nodes().size());
// does it really gracefully shut the nodes down?
// Ignition.stop(ignite1.name(), false);
// Ignition.stop(ignite2.name(), false);
}
}
I tried to modified the ignite storage to make it behave more like in-memory but wasn't successful to change the numbers.
java ignite
add a comment |
I'm trying to replicate a simple producer-consumer scenario in Ignite:
public class QueueExample {
public static void main(String args) {
new QueueExample().start();
}
private void start() {
final AtomicBoolean finishedTest1 = new AtomicBoolean(false);
final BlockingQueue<Double> queue = new LinkedBlockingQueue<>(5);
final CountDownLatch latch = new CountDownLatch(2);
final int MAX = 1000;
new Thread(() -> {
System.out.println("test1 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < MAX; i++) {
try {
queue.put(r.nextDouble());
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
sw.stop();
finishedTest1.set(true);
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test1. " + test + ", took:" + sw.getTime() / 1000f);
}).start();
new Thread(() -> {
System.out.println("test2 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < MAX ; i++) {
Double res = queue.poll(1, TimeUnit.SECONDS);
counter++;
}
} catch (InterruptedException e) {
// expected
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test2. counter " + counter + ", finished:" + finishedTest1.get() + ", took:" + sw.getTime() / 1000f);
}).start();
}
}
Why is this 100 times faster (0.02sec vs. <2sec) compared to the following Ignite code?
public class MyIgnite {
public static void main(String args) {
new MyIgnite().start();
}
private void start() {
IgniteConfiguration icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test1");
Ignite ignite1 = Ignition.start(icfg);
final CountDownLatch latch = new CountDownLatch(2);
final int queueSize = 5;
CollectionConfiguration queueCfg = new CollectionConfiguration();
ignite1.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test1 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000; i++) {
queue.put(r.nextDouble());
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test1. " + test + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("starting test2");
icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test2");
Ignite ignite2 = Ignition.start(icfg);
ignite2.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test2 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < 1000; i++) {
Double res = queue.poll(5, TimeUnit.SECONDS);
counter++;
}
} catch (IgniteException exc) {
System.out.println("Somehow cannot poll. " + exc);
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test2. counter " + counter + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("oldest node: " + ignite1.cluster().forOldest().hostNames());
System.out.println("nodes: " + ignite1.cluster().nodes().size());
// does it really gracefully shut the nodes down?
// Ignition.stop(ignite1.name(), false);
// Ignition.stop(ignite2.name(), false);
}
}
I tried to modified the ignite storage to make it behave more like in-memory but wasn't successful to change the numbers.
java ignite
Taking into account some kind of warm up phase and executing this for e.g. 400k elements I do observe an even bigger factor of over 500x slower. I tried various configurations for memory and storage but without luck so far. Of course I would have expected a slow down if I enable storage but more in the range of 5x, especially as the default configuration seems to be persistenceEnabled=false
– Karussell
Nov 26 '18 at 13:36
Looks like redis+redisson gives similar results (although 3 times faster)
– Karussell
Nov 29 '18 at 23:44
add a comment |
I'm trying to replicate a simple producer-consumer scenario in Ignite:
public class QueueExample {
public static void main(String args) {
new QueueExample().start();
}
private void start() {
final AtomicBoolean finishedTest1 = new AtomicBoolean(false);
final BlockingQueue<Double> queue = new LinkedBlockingQueue<>(5);
final CountDownLatch latch = new CountDownLatch(2);
final int MAX = 1000;
new Thread(() -> {
System.out.println("test1 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < MAX; i++) {
try {
queue.put(r.nextDouble());
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
sw.stop();
finishedTest1.set(true);
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test1. " + test + ", took:" + sw.getTime() / 1000f);
}).start();
new Thread(() -> {
System.out.println("test2 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < MAX ; i++) {
Double res = queue.poll(1, TimeUnit.SECONDS);
counter++;
}
} catch (InterruptedException e) {
// expected
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test2. counter " + counter + ", finished:" + finishedTest1.get() + ", took:" + sw.getTime() / 1000f);
}).start();
}
}
Why is this 100 times faster (0.02sec vs. <2sec) compared to the following Ignite code?
public class MyIgnite {
public static void main(String args) {
new MyIgnite().start();
}
private void start() {
IgniteConfiguration icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test1");
Ignite ignite1 = Ignition.start(icfg);
final CountDownLatch latch = new CountDownLatch(2);
final int queueSize = 5;
CollectionConfiguration queueCfg = new CollectionConfiguration();
ignite1.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test1 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000; i++) {
queue.put(r.nextDouble());
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test1. " + test + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("starting test2");
icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test2");
Ignite ignite2 = Ignition.start(icfg);
ignite2.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test2 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < 1000; i++) {
Double res = queue.poll(5, TimeUnit.SECONDS);
counter++;
}
} catch (IgniteException exc) {
System.out.println("Somehow cannot poll. " + exc);
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test2. counter " + counter + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("oldest node: " + ignite1.cluster().forOldest().hostNames());
System.out.println("nodes: " + ignite1.cluster().nodes().size());
// does it really gracefully shut the nodes down?
// Ignition.stop(ignite1.name(), false);
// Ignition.stop(ignite2.name(), false);
}
}
I tried to modified the ignite storage to make it behave more like in-memory but wasn't successful to change the numbers.
java ignite
I'm trying to replicate a simple producer-consumer scenario in Ignite:
public class QueueExample {
public static void main(String args) {
new QueueExample().start();
}
private void start() {
final AtomicBoolean finishedTest1 = new AtomicBoolean(false);
final BlockingQueue<Double> queue = new LinkedBlockingQueue<>(5);
final CountDownLatch latch = new CountDownLatch(2);
final int MAX = 1000;
new Thread(() -> {
System.out.println("test1 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < MAX; i++) {
try {
queue.put(r.nextDouble());
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
sw.stop();
finishedTest1.set(true);
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test1. " + test + ", took:" + sw.getTime() / 1000f);
}).start();
new Thread(() -> {
System.out.println("test2 before latch");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println(new Date().getTime() + " start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < MAX ; i++) {
Double res = queue.poll(1, TimeUnit.SECONDS);
counter++;
}
} catch (InterruptedException e) {
// expected
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println(new Date().getTime() + " end test2. counter " + counter + ", finished:" + finishedTest1.get() + ", took:" + sw.getTime() / 1000f);
}).start();
}
}
Why is this 100 times faster (0.02sec vs. <2sec) compared to the following Ignite code?
public class MyIgnite {
public static void main(String args) {
new MyIgnite().start();
}
private void start() {
IgniteConfiguration icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test1");
Ignite ignite1 = Ignition.start(icfg);
final CountDownLatch latch = new CountDownLatch(2);
final int queueSize = 5;
CollectionConfiguration queueCfg = new CollectionConfiguration();
ignite1.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test1 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(20, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test1");
double test = 2;
Random r = new Random();
StopWatch sw = new StopWatch();
sw.start();
for (int i = 0; i < 1000; i++) {
queue.put(r.nextDouble());
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test1. " + test + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("starting test2");
icfg = new IgniteConfiguration();
icfg.setIgniteInstanceName("test2");
Ignite ignite2 = Ignition.start(icfg);
ignite2.compute().runAsync(new IgniteRunnable() {
@IgniteInstanceResource
Ignite ignite;
@Override
public void run() {
IgniteQueue<Double> queue = ignite.queue("test", queueSize, queueCfg);
System.out.println("test2 fetched queue");
latch.countDown();
try {
// wait until other runnable is able to poll
latch.await(10, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
System.out.println("start test2");
StopWatch sw = new StopWatch();
sw.start();
int counter = 0;
try {
for (int i = 0; i < 1000; i++) {
Double res = queue.poll(5, TimeUnit.SECONDS);
counter++;
}
} catch (IgniteException exc) {
System.out.println("Somehow cannot poll. " + exc);
}
sw.stop();
//LoggerFactory.getLogger(getClass()).info
System.out.println("end test2. counter " + counter + " at ignite " + ignite.name() + ", took:" + sw.getTime() / 1000f);
}
});
System.out.println("oldest node: " + ignite1.cluster().forOldest().hostNames());
System.out.println("nodes: " + ignite1.cluster().nodes().size());
// does it really gracefully shut the nodes down?
// Ignition.stop(ignite1.name(), false);
// Ignition.stop(ignite2.name(), false);
}
}
I tried to modified the ignite storage to make it behave more like in-memory but wasn't successful to change the numbers.
java ignite
java ignite
asked Nov 24 '18 at 0:37
KarussellKarussell
11.9k1175161
11.9k1175161
Taking into account some kind of warm up phase and executing this for e.g. 400k elements I do observe an even bigger factor of over 500x slower. I tried various configurations for memory and storage but without luck so far. Of course I would have expected a slow down if I enable storage but more in the range of 5x, especially as the default configuration seems to be persistenceEnabled=false
– Karussell
Nov 26 '18 at 13:36
Looks like redis+redisson gives similar results (although 3 times faster)
– Karussell
Nov 29 '18 at 23:44
add a comment |
Taking into account some kind of warm up phase and executing this for e.g. 400k elements I do observe an even bigger factor of over 500x slower. I tried various configurations for memory and storage but without luck so far. Of course I would have expected a slow down if I enable storage but more in the range of 5x, especially as the default configuration seems to be persistenceEnabled=false
– Karussell
Nov 26 '18 at 13:36
Looks like redis+redisson gives similar results (although 3 times faster)
– Karussell
Nov 29 '18 at 23:44
Taking into account some kind of warm up phase and executing this for e.g. 400k elements I do observe an even bigger factor of over 500x slower. I tried various configurations for memory and storage but without luck so far. Of course I would have expected a slow down if I enable storage but more in the range of 5x, especially as the default configuration seems to be persistenceEnabled=false
– Karussell
Nov 26 '18 at 13:36
Taking into account some kind of warm up phase and executing this for e.g. 400k elements I do observe an even bigger factor of over 500x slower. I tried various configurations for memory and storage but without luck so far. Of course I would have expected a slow down if I enable storage but more in the range of 5x, especially as the default configuration seems to be persistenceEnabled=false
– Karussell
Nov 26 '18 at 13:36
Looks like redis+redisson gives similar results (although 3 times faster)
– Karussell
Nov 29 '18 at 23:44
Looks like redis+redisson gives similar results (although 3 times faster)
– Karussell
Nov 29 '18 at 23:44
add a comment |
1 Answer
1
active
oldest
votes
You're comparing an aircraft carrier to a toy boat here.
LinkedBlockingQueue is a data structure that works in a memory of a single JVM.
IgniteQueue is a distributed structure based on the Ignite's key-value storage. It can work on hundreds of machines, with different consistency levels, with backup copies, with persistence. Of course, it is supported by a lot of machinery under the hood, and it is slower than a simple local queue.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53454232%2fapache-ignite-queue-much-slower-compared-to-linkedblockingqueue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're comparing an aircraft carrier to a toy boat here.
LinkedBlockingQueue is a data structure that works in a memory of a single JVM.
IgniteQueue is a distributed structure based on the Ignite's key-value storage. It can work on hundreds of machines, with different consistency levels, with backup copies, with persistence. Of course, it is supported by a lot of machinery under the hood, and it is slower than a simple local queue.
add a comment |
You're comparing an aircraft carrier to a toy boat here.
LinkedBlockingQueue is a data structure that works in a memory of a single JVM.
IgniteQueue is a distributed structure based on the Ignite's key-value storage. It can work on hundreds of machines, with different consistency levels, with backup copies, with persistence. Of course, it is supported by a lot of machinery under the hood, and it is slower than a simple local queue.
add a comment |
You're comparing an aircraft carrier to a toy boat here.
LinkedBlockingQueue is a data structure that works in a memory of a single JVM.
IgniteQueue is a distributed structure based on the Ignite's key-value storage. It can work on hundreds of machines, with different consistency levels, with backup copies, with persistence. Of course, it is supported by a lot of machinery under the hood, and it is slower than a simple local queue.
You're comparing an aircraft carrier to a toy boat here.
LinkedBlockingQueue is a data structure that works in a memory of a single JVM.
IgniteQueue is a distributed structure based on the Ignite's key-value storage. It can work on hundreds of machines, with different consistency levels, with backup copies, with persistence. Of course, it is supported by a lot of machinery under the hood, and it is slower than a simple local queue.
answered Dec 3 '18 at 13:44
Stanislav LukyanovStanislav Lukyanov
1,091513
1,091513
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53454232%2fapache-ignite-queue-much-slower-compared-to-linkedblockingqueue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Taking into account some kind of warm up phase and executing this for e.g. 400k elements I do observe an even bigger factor of over 500x slower. I tried various configurations for memory and storage but without luck so far. Of course I would have expected a slow down if I enable storage but more in the range of 5x, especially as the default configuration seems to be persistenceEnabled=false
– Karussell
Nov 26 '18 at 13:36
Looks like redis+redisson gives similar results (although 3 times faster)
– Karussell
Nov 29 '18 at 23:44