Skip to content

new PR for STORM-2306 : Messaging subsystem redesign - #2502

Merged
asfgit merged 1 commit into
apache:masterfrom
roshannaik:STORM-2306-2
Feb 14, 2018
Merged

new PR for STORM-2306 : Messaging subsystem redesign#2502
asfgit merged 1 commit into
apache:masterfrom
roshannaik:STORM-2306-2

Conversation

@roshannaik

@roshannaik roshannaik commented Jan 5, 2018

Copy link
Copy Markdown
Contributor

Since the old PR page had become unusable (due to lots of old comments). Creating this new PR as a replacement for the old PR.

Results for comparative performance runs between master branch (#aaebc3b) and 2306.
https://docs.google.com/document/d/1A5k41UjVFY8jZg01BHc1fFxmI0AcFz5jRiKhNjhOj7I/edit?usp=sharing

@roshannaik roshannaik changed the title new PR for STORM-2306 new PR for STORM-2306 : Messaging subsystem redesign Jan 5, 2018
@roshannaik

Copy link
Copy Markdown
Contributor Author

@revans2 , UTs for the storm-client module were fixed (including JCQueueTest). They run cleanly for me. Are you seeing them fail in your local setup ?

Rebasing: Due to the length of the review cycle this PR needed and the need for a stable point for perf runs, I avoided keeping up to date with latest master, so far. Planning to address all review comments first. There are around 300 commits on master to catch up on right now. Will take me a week I think to rebase.

@revans2

revans2 commented Jan 5, 2018

Copy link
Copy Markdown
Contributor

@roshannaik I may have checked it out wrong, I will try again...

@revans2

revans2 commented Jan 5, 2018

Copy link
Copy Markdown
Contributor

Yes I checked it out wrong... My bad.

@revans2

revans2 commented Jan 5, 2018

Copy link
Copy Markdown
Contributor

I am still seeing test failures when running mvn clean install -Pall-tests -fn | tee log.txt

integration.org.apache.storm.integration-test Looks like an NPE at ExecutorTransfer.java:114 appears to be an issue with initializing the local receive queues.

storm-starter is also getting several errors. test-intermediate-rankings-bolt is getting an array index out of bounds exception using RankableObjectWithFields

test-exclamation-bolt, test-total-rankings-bolt and test-rolling-bolt are getting an NPE at GeneralTopologyContext.java:112 which looks like the component to stream table is not being setup properly, at least for the clojure API.

I'll see if there is more that I can come up with, and I'll try to spend more time looking at the actual code changes.

@revans2 revans2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finished a pass through all of the code. I didn't get as in depth as I had hoped, especially with threading.

I am nervous that some of the routing code that was originally called from the thread that pulled off of the send queue may not be thread safe, and is not being called from arbitrary user threads during an emit.

But overall it looks fairly good.

Comment thread docs/Performance.md
@@ -0,0 +1,132 @@
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Documentation, but can we have some of the other docs link to it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am putting a link to this doc from Concepts.md. If you have better place in mind please let me know.

* @param func the function to run
*/
public void scheduleRecurringMs(long delayMs, final long recurMs, final Runnable func) {
scheduleMs(delayMs, new Runnable() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit could we use a java 8 lambda here instead?

scheduleMs(delayMs, () -> {
    func.run();
    // This avoids a race condition with cancel-timer.
    scheduleMs(recurMs, this, true, 0);
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem feasible due to the 'this' reference inside the lambda.

public static final String STORMS_ROOT = "storms";
public static final String SUPERVISORS_ROOT = "supervisors";
public static final String WORKERBEATS_ROOT = "workerbeats";
public static final String BACKPRESSURE_ROOT = "backpressure";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to support running older topology versions under a newer 2.x nimbus/etc we should still keep around the basic setup and cleanup of the backpressure nodes in zookeeper at least until a 3.x release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@revans2 can u you clarify ? 2.x will require topo jars to be rebuilt for it.

metricMap.put("skipped-max-spout-ms", skippedMaxSpoutMs);
metricMap.put("skipped-throttle-ms", skippedThrottleMs);
metricMap.put("skipped-inactive-ms", skippedInactiveMs);
metricMap.put("skipped-backpressure-ms", skippedBackPressureMs);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./docs/Metrics.md describes these. It should be updated to remove skipped-throttle-ms and replaced with skipped-backpressure-ms (and preferably mention that in older versions of storm skipped-throttle-ms would have been similar)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

if (entry.getValue().isEmptyOverflow()) {
// move task from bpTasks to noBpTasks
nonBpTasks.add(entry.getKey());
itr.remove();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there is a race condition here with recordBackpressure. If nonBpTasks.add(entry.getKey()) finishes and then we get a context switch and recordBackpressure completes fully for the same taskId then itr.remove happens we might have an inconsistent state.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next update will simplify the logic by using a single map and fix this issue as well.

oldS = newS;
}
if (++count == printFreq) {
System.err.printf(" ***> %s - %,.2f\n", name, mean());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we log this instead of printing it? Also could you file a follow on JIRA so that when we go to a better metrics implementation that we use that instead of printing/logging?


public static final Object INTERRUPT = new Object();

private final ThroughputMeter emptyMeter = new ThroughputMeter("EmptyBatch");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never reported anywhere... Do we want to just delete it and move ThroughputMeter to perf?

if (s==null) // then stop running it
break;
if (s>0)
Thread.sleep(s);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be Time.sleep if we want simulated time to work properly....

new HashMap<>(),
new AtomicBoolean(false));
return new TupleImpl(context, values, 1, stream);
return new TupleImpl(context, values, "component", 1, stream);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I think is the cause of some of the test failures....

protected final long lowMemoryThresholdMB;
protected final long mediumMemoryThresholdMb;
protected final long mediumMemoryGracePeriodMs;
private static int port = 5006; // TODO: Roshan: remove this after stabilization

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please make sure this is removed, as leaving it in place is a security vulnerability.

/**
* Send sampled data to the eventlogger if the global or component level debug flag is set (via nimbus api).
*/
public void sendToEventLogger(Executor executor, List values,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HeartSaVioR you pointed out some optimizations are possible to this .. that we can tackle in another jira ... can you elaborate or capture your thoughts into a jira ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reread the code and found sampling percentage can be changed. I was thinking about reducing random.nextDouble(), but in this case we may not be able to do that. Please ignore my previous comment.

@HeartSaVioR HeartSaVioR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see only one comment is yet to address. Thanks for addressing review comments.

((BoltExecutorStats) executor.getStats()).boltFailedTuple(
input.getSourceComponent(), input.getSourceStreamId(), delta);
boltFailInfo.applyOn(task.getUserContext());
if (delta != 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like missed spot : this should be delta >= 0.

https://github.com/apache/storm/pull/2241/files?diff=split#r158213916

 (when (<= 0 delta) 
   (stats/bolt-failed-tuple! executor-stats 
                             (.getSourceComponent tuple) 
                             (.getSourceStreamId tuple) 
                             delta)))) 

@roshannaik
roshannaik force-pushed the STORM-2306-2 branch 2 times, most recently from d6ed79d to d68720e Compare February 2, 2018 01:18
@roshannaik

Copy link
Copy Markdown
Contributor Author

Update:

  • The code has been rebased to latest master.
  • Getting clean test runs on my local machine
  • Travis runs are indicating these test failures.
  1. storm-client:JCQueueTest - is failing for some reason here but working ok for me. I will look into it.
  2. storm-core - The exact test or the nature of the failure is not clear from the travis logs. See some exceptions that are talking about MetricsStore ... this might not be related to this PR.
  3. org.apache.storm.cassandra.trident.MapStateTest Seems to be stalling and causing a failure.

The cause of the last two failures is unclear to me as they are passing on my local machine and I cant see anything interesting in the Travis logs.

@revans2 : Have that open question for you wrt that race condition you brought up wrt ExecutorTransfer::remotesBatchSz. Rest everything has been addressed.

@HeartSaVioR

Copy link
Copy Markdown
Contributor

Looks like storm-core error is related to worker crash while shutting down.

https://travis-ci.org/apache/storm/jobs/336372156

36913 [SLOT_1027] INFO  o.a.s.e.ExecutorShutdown - Shut down executor 2:[3, 3]
36913 [SLOT_1027] INFO  o.a.s.e.ExecutorShutdown - Shutting down executor 19d8dc30-7afc-44b1-a466-26064b50a580:[2, 2]
36913 [Thread-334-19d8dc30-7afc-44b1-a466-26064b50a580-executor[2, 2]] INFO  o.a.s.u.Utils - Async loop interrupted!
36914 [SLOT_1027] INFO  o.a.s.e.ExecutorShutdown - Shut down executor 19d8dc30-7afc-44b1-a466-26064b50a580:[2, 2]
36914 [SLOT_1027] INFO  o.a.s.e.ExecutorShutdown - Shutting down executor 1:[1, 1]
36914 [Thread-335-1-executor[1, 1]] INFO  o.a.s.u.Utils - Async loop interrupted!
36914 [SLOT_1027] INFO  o.a.s.e.ExecutorShutdown - Shut down executor 1:[1, 1]
36914 [SLOT_1027] INFO  o.a.s.d.w.Worker - Shut down executors
36914 [SLOT_1027] INFO  o.a.s.d.w.Worker - Shutting down transfer thread
36914 [Worker-Transfer] ERROR o.a.s.u.Utils - Async loop died!
java.lang.ClassCastException: java.lang.Object cannot be cast to org.apache.storm.messaging.TaskMessage
	at org.apache.storm.daemon.worker.WorkerTransfer.accept(WorkerTransfer.java:84) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.JCQueue.consumeImpl(JCQueue.java:309) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.JCQueue.consume(JCQueue.java:290) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.JCQueue.consume(JCQueue.java:281) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.daemon.worker.WorkerTransfer.lambda$makeTransferThread$0(WorkerTransfer.java:75) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.Utils$2.run(Utils.java:350) [storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
36914 [Worker-Transfer] ERROR o.a.s.u.Utils - Async loop died!
java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Object cannot be cast to org.apache.storm.messaging.TaskMessage
	at org.apache.storm.utils.Utils$2.run(Utils.java:363) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to org.apache.storm.messaging.TaskMessage
	at org.apache.storm.daemon.worker.WorkerTransfer.accept(WorkerTransfer.java:84) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.JCQueue.consumeImpl(JCQueue.java:309) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.JCQueue.consume(JCQueue.java:290) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.JCQueue.consume(JCQueue.java:281) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.daemon.worker.WorkerTransfer.lambda$makeTransferThread$0(WorkerTransfer.java:75) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.Utils$2.run(Utils.java:350) ~[storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	... 1 more
36915 [Worker-Transfer] ERROR o.a.s.u.Utils - Halting process: Async loop died!
java.lang.RuntimeException: Halting process: Async loop died!
	at org.apache.storm.utils.Utils.exitProcess(Utils.java:465) [storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at org.apache.storm.utils.Utils$3.uncaughtException(Utils.java:373) [storm-client-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
	at java.lang.Thread.dispatchUncaughtException(Thread.java:1959) [?:1.8.0_151]

@revans2

revans2 commented Feb 8, 2018

Copy link
Copy Markdown
Contributor

This looks really really good. I ran through the unit tests and some performance tests and everything looks great. Now I feel like I can get excited about this going in. I am going to spend tomorrow going through the code, but I am really hopeful that we can get this merged in next week.

@roshannaik

roshannaik commented Feb 8, 2018

Copy link
Copy Markdown
Contributor Author

@revans2 and @HeartSaVioR
Just rebased this PR and also included the fix for making ExecutorTransfer.tryTransfer() thread safe to allow concurrent emits from background threads spun by the Bolt/Spout executors.

I am hoping we can revisit this topic of how to allow concurrent emits without making it internally thread safe, after this PR is merged.
This fix should unblock this PR and allow us to discuss the issue separately.

@revans2 revans2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it through the code and it looks good. Most things are nits.

I would like to see the link to the perf docs fixed.
I would like to understand why the acker code changed
and most of all I want to make sure that the backpressure serialization works when java serialization is disabled.

But once those happen I am +1 on the change, and the others nits can be wither cleaned up now or in a follow on JIRA.

Comment thread docs/Concepts.md Outdated

### Performance Tuning

Refer to [performance tuning guide](docs/CONTRIBUTING.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think CONTRIBUTING.md is the performance tuning guide, also the path is relative, and since Performance.md is in the same directory as this we don't need the docs/ in the link

package org.apache.storm.flux.multilang;


import org.junit.Ignore;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't think this is used in here, so can we remove it?

Comment thread pom.xml
<snakeyaml.version>1.11</snakeyaml.version>
<httpclient.version>4.3.3</httpclient.version>
<clojure.tools.cli.version>0.2.4</clojure.tools.cli.version>
<jctools.version>2.0.1</jctools.version>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does flux need jctools? Shouldn't it come with storm-client?

@roshannaik roshannaik Feb 10, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see any references to jctools in any flux related pom. i do see it in the storm-client's pom. Can you point to the specific offending location ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I misread things, please ignore this comment.

* vs. CPU usage
* Selects the Bolt's Wait Strategy to use when there are no incoming msgs. Used to trade off latency vs CPU usage.
*/
@isString

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check if this is an instance of the proper parent interface?

* 2. The spout has hit maxSpoutPending and can't emit any more tuples
*/
@isString
public static final String TOPOLOGY_BACKPRESSURE_WAIT_STRATEGY="topology.backpressure.wait.strategy";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too if this is a class name it would be good to verify that it is an instance of a given class early on.

private IWaitStrategy backPressureWaitStrategy;

JCQueue transferQueue; // [remoteTaskId] -> JCQueue. Some entries maybe null (if no emits to those tasksIds from this worker)
AtomicBoolean[] remoteBackPressureStatus; // [[remoteTaskId] -> true/false : indicates if remote task is under BP.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for package private.

if ((!Acker.ACKER_COMPONENT_ID.equals(componentId) && Utils.isSystemId(componentId))
|| (!enableMessageTimeout && isSpout)) {
LOG.info("Timeouts disabled for executor {}:{}", componentId, executorId);
LOG.info("Timeouts disabled for executor " + componentId + ":" + executorId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why did we go back to String concatenation?

private final Boolean isEventLoggers;
private final Boolean isDebug;
private final RotatingMap<Long, TupleInfo> pending;
private TupleInfo globalTupleInfo = new TupleInfo(); // thread safety: assumes Collector.emit*() calls are externally synchronized (if needed).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a good assumption for a spout, but I would like to understand the cost of making this thread safe (thread local instance etc), and at least document it if that cost is high, or preferably find a low cost solution to throw an exception if it does happen.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accessing the Thread Local (TL) instance via ThreadLocal.get() typically involves a map lookup behind the scenes.

Related Note: I reluctantly used TL for latching on to JCQueue.BatchInserter instance for the producers to JCQueue. Reluctant since I noticed perf hit when doing some targeted microbenchmarking. I used it anyway because it was a perf improvement over the ConcurrentHashMap employed in Disruptor, and eliminating TL needed a bigger change to the interface and producers. I think it is possible to achieve TL free JCQueue and gain some perf.. perhaps in a follow up jira.

Although many decisions were measured, due to scope it was not feasible to measure each one. So, in the critical path, I have taken this general approach of :

  • avoid locks & synchronization ... and try using lock/wait-free approaches where synchronization is unavoidable.
  • avoid map lookups and object creation

This was a case of avoiding synchronization, (TL) map lookups & object allocation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do a sanity check for the fast path + documentation? Check if the thread id is the same as the id of the main thread we expect emits to come from. If so we go with the fast path, if not we have a thread local or do some kind of locking + documentation about why you never want the spout to emit from a background thread.

@roshannaik roshannaik Feb 13, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get the id of the current thread involves a call to Thread.currentThread() which is quite expensive... so not good to use in fast path.

I am introducing that check if topology.debug is enabled as a compromise. This mode could
be used mode to do any checks in dev mode that are unnecessary or expensive to do repeatedly in production.

I have opened: STORM-2945 to nail down and document background emits support.. we can document both spout & bolt support semantics together in the same document.

import java.util.concurrent.atomic.AtomicLong;

// Instances of this type are sent from NettyWorker to upstream WorkerTransfer to indicate BackPressure situation
public class BackPressureStatus implements java.io.Serializable {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be serializable if we are explicitly using kryo for all of the serialization? Can we just register the class with kryo instead so this will also work when java serialization is disabled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not aware of that. Do we have an example of what i should do instead ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k.register(ArrayList.class, new ArrayListSerializer());
k.register(HashMap.class, new HashMapSerializer());
k.register(HashSet.class, new HashSetSerializer());
k.register(BigInteger.class, new BigIntegerSerializer());
k.register(TransactionAttempt.class);
k.register(Values.class);
k.register(org.apache.storm.metric.api.IMetricsConsumer.DataPoint.class);
k.register(org.apache.storm.metric.api.IMetricsConsumer.TaskInfo.class);
k.register(ConsList.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to get away with just registering the class and not providing a serializer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm interesting.
Wondering why ControlMessage, MessageBatch & SaslMessageToken dont follow the same pattern of registering ?

Can you confirm that you are suggesting the following steps ?

  • Remove the inheritance from Serializable interface
  • Register BackPressureStatus.class with kryo
  • Remove the BackPressureStatus.buffer() and BackPressureStatus.read() methods ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ControlMessage, MessageBatch and SaslMessageToken are handled explicitly by MessageDecoder and MessageEncoder using the buffer and read methods.
When ControlMessage, SaslMessageToken, or Message Batch writes themselves out to a buffer they do not use kryo to do it.

public ChannelBuffer buffer() throws IOException {
ChannelBufferOutputStream bout = new ChannelBufferOutputStream(ChannelBuffers.directBuffer(encodeLength()));
write(bout);
bout.close();
return bout.buffer();

public ChannelBuffer buffer() throws IOException {
ChannelBufferOutputStream bout = new ChannelBufferOutputStream(
ChannelBuffers.directBuffer(encodeLength()));
int payload_len = 0;
if (token != null)
payload_len = token.length;
bout.writeShort(IDENTIFIER);
bout.writeInt(payload_len);
if (payload_len > 0) {
bout.write(token);
}
bout.close();
return bout.buffer();
}

ChannelBuffer buffer() throws Exception {
ChannelBufferOutputStream bout = new ChannelBufferOutputStream(ChannelBuffers.directBuffer(encoded_length));
for (TaskMessage msg : msgs) {
writeTaskMessage(bout, msg);
}
//add a END_OF_BATCH indicator
ControlMessage.EOB_MESSAGE.write(bout);
bout.close();
return bout.buffer();
}

It is a hand coded protocol (for good or bad).

The messages inside MessageBatch have already been serialized using kryo elsewhere in the pipeline.

For the load messages we hid them as a tuple inside a MessageBatch. We did this so we could do a rolling upgrade with it, but it is an ugly hack.

BackPressureStatus is serialized/deserialized using MessageEncoder/MessageDecoder, but it uses kryo internally to do it.

So please remove Serializable from BackPressureStatus. Register it with kryo. Do not remove BackPressureStatus.buffer() nor BackPressureStatus.read(). I think the changes to KryoTupleSerializer to send a BackPressureState can be removed assuming no one is calling them directly.

The simplest way to test this is to run a topology with multiple workers and topology.fall.back.on.java.serialization=false. This is a config that makes it so kryo does not fall back to java serialization when trying to use kryo.

For normal tuples/end users you can set topology.testing.always.try.serialize=true and every tuple emitted will be serialized, even in local mode. This is a way to unit test that you have setup kryo appropriately, but this BackPressureStatus is a special message so we need to do it differently.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed comment. Made the changes and tested them as well.


@Override
public void flush() {
//NOOP //TODO: Roshan: validate if this is OK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO needs to go away. Is this OK to not have a flush?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to flush.

@roshannaik
roshannaik force-pushed the STORM-2306-2 branch 3 times, most recently from f92a206 to dc53b2a Compare February 13, 2018 14:46
@roshannaik

Copy link
Copy Markdown
Contributor Author

I think I have addressed all the major and minor issues as well.


public final String workerId;
public String workerId;
public final long id; // monotonically increasing id

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering: the characteristic of monotonically increasing guarantee id to be unique in a worker, but not among workers, and also reset to 0 after worker crash and restart. Does it hurt the backpressure logic at any chance?

private static AtomicLong bpCount = new AtomicLong(0);

public String workerId;
public final long id; // monotonically increasing id

@HeartSaVioR HeartSaVioR Feb 13, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to leave two duplicated comments: I commented to old commit.

Just wondering: the characteristic of monotonically increasing guarantees id to be unique in a worker, but not among workers, and also reset to 0 after worker crash and restart. Does it hurt the backpressure logic at any chance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its only for debugging purposes.. so that we can co-relate sent & recvd msgs. I have used it to measure latency involved in transmission of BackPressureStatus msgs.

@HeartSaVioR HeartSaVioR Feb 13, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks for clarification. I thought it as a kind of guarantee we should ensure. Maybe better to clear out that that's not a requirement and only for debugging purpose.

@revans2 revans2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 this looks good to me. I know this is big so if there are others looking at this patch please say something soon. Otherwise @roshannaik could you squash your commits tomorrow sometime and then I will be happy to merge this in.

import java.util.List;
import java.util.Random;

// Methods are not thread safe. Each thread expected to have a separate instance, or else synchronize externally

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: better to make it as javadoc so that it can be exposed to more ways.

As @revans2 stated, I also think this is a good assumption for a spout, but even better to update the restriction if we have documented any. That's just a 2 cents, not blocker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To nail down and document the concurrent emits semantics I had opened STORM-2945

@HeartSaVioR HeartSaVioR Feb 13, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought STORM-2945 was filed to find the way to support background emit without external synchronization, so likely having the chance to keep it unresolved in 2.x. If you intended to document how to enable background emit with current state in STORM-2945, please ignore the comment here.

I still think it is good to change class line comment to be a javadoc format, but it is just a nit, not a thing to block.

@roshannaik roshannaik Feb 13, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is to figure out what will have for Storm 2.0... since we cannot make any breaking changes even if we like to thereafter until 3.0. will change this to javadoc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Please let me know if you plan to figure out in time frame of Storm 2.0.0. I'll add it in epic of releasing Storm 2.0.0. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please thats the intent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@HeartSaVioR

Copy link
Copy Markdown
Contributor

I'm running performance test (TVL) to see there's any regression here. As @revans2 already did performance test, I wouldn't spend the time going through too deeply (just couple of tests). I would provide +1 after things are going well.

@HeartSaVioR

HeartSaVioR commented Feb 14, 2018

Copy link
Copy Markdown
Contributor

Here's my test result: TVL with rate 85000 and max spout pending 5000. spouts/splitters/counters are set to same as worker count.

Again, this is just to see if there's clear performance regression from TVL which we have been using. Full analysis like google doc in STORM-2306 would require so much efforts and resources (dedicated machines). If we could update the numbers with latest master vs latest patch of STORM-2306 it would be really great, but we should be OK if we postpone measuring numbers just before releasing Storm 2.0.0 comparing with latest Storm 1.x release.

4 workers

master (ab7b4ca)

(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,660.500      1,482.288      3,808.428      3,942.646          6.554        329.044              0
 30     82,245.581         10.817         27.607         50.430          5.093        364.626              0
 61     85,022.500         10.495         21.316         36.405          5.192        242.701              0
 91     84,994.733         10.365         19.186         29.688          5.152        399.110              0
121     85,008.333         10.385         19.595         29.016          5.195        269.351              0
151     84,999.867         10.367         19.005         29.000          5.156        361.585              0
181     85,006.133         10.361         18.285         24.953          5.215        319.568              0
211     85,007.433         10.373         18.547         26.018          5.227        374.250              0
241     84,978.300         10.390         19.153         29.852          5.107        240.743              0
271     85,025.733         10.351         18.366         28.934          5.134        308.930              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     24,746.933      2,497.621      3,498.050      3,571.450          4.175        480.104              0
 30     88,589.100        160.265      1,622.147      1,778.385          5.883        329.437              0
 60     85,012.833         10.494         20.120         31.326          5.211        421.895              0
 90     84,993.867         10.394         18.956         26.132          5.185        434.169              0
120     85,008.100         10.474         20.201         31.523          5.194        440.354              0
150     85,001.067         10.396         18.776         28.574          5.238        449.158              0
180     85,005.633         10.477         20.283         35.127          5.289        441.979              0
210     84,994.833         10.390         18.678         29.295          5.136        419.486              0
240     85,011.167         10.370         18.219         26.051          5.219        308.977              0
270     85,007.600         10.438         19.317         27.804          5.158        403.509              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,648.833      1,368.022      3,565.158      3,682.599          6.476        405.396              0
 30     85,045.067         10.725         23.446         44.007          5.249        448.851              0
 60     85,002.400         10.527         19.874         28.901          5.209        452.087              0
 90     84,997.800         10.412         19.694         34.341          5.136        356.300              0
120     84,995.033         10.451         20.267         29.802          5.174        379.923              0
150     85,019.533         10.413         19.153         30.556          5.193        398.516              0
180     85,001.367         10.371         18.448         25.182          5.191        331.490              0
210     85,004.400         10.386         18.874         24.101          5.195        368.889              0
240     84,991.367         10.368         18.416         25.018          5.132        392.701              0
270     85,004.367         10.469         19.808         35.586          5.147        443.393              0

STORM-2306 (5b54809)

(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     28,098.000      1,549.653      3,183.477      3,227.517          4.041        192.208              0
 30     85,306.133         13.650        270.795        406.585          8.958        275.171              0
 60     85,007.067          5.466         17.449         28.836          9.023        287.177              0
 90     92,084.333          5.483         17.269         26.280          9.004        212.465              0
120     84,999.400          5.561         17.662         29.458          9.739        368.272              0
150     85,005.367          5.593         17.449         37.126          8.979        293.334              0
180     92,082.733          5.584         18.219         28.787          8.981        334.805              0
210     85,008.000          5.571         18.022         29.213          8.962        363.184              0
240     84,992.867          5.604         17.662         39.191          9.020        271.483              0
270     92,094.467          5.590         17.351         24.953          8.939        320.613              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,779.467        728.445      2,967.470      3,066.036          7.032        308.975              0
 30     84,986.933          5.851         21.037         33.489          9.101        404.124              0
 60     85,021.833          5.593         18.301         29.049          9.104        377.985              0
 90     85,000.500          5.577         17.465         26.853          9.101        343.799              0
120     85,009.300          5.714         18.661         29.196          9.084        252.083              0
150     84,998.533          5.532         16.957         26.460          9.114        252.234              0
180     85,005.300          5.588         16.810         26.165          9.102        227.976              0
210     84,997.633          5.708         19.055         32.096          9.157        294.213              0
240     84,994.433          5.692         18.481         30.261          9.046        365.903              0
270     85,015.500          5.590         18.022         28.197          9.080        401.871              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     34,802.167      1,451.699      3,227.517      3,275.751          4.887        358.051              0
 30     99,803.667         26.173        740.295        880.804          9.226        349.733              0
 60     92,079.433          5.790         20.398         34.800         11.521        254.316              0
 90     85,002.100          5.590         17.220         27.361          9.218        333.207              0
120     84,998.033          5.750         18.432         28.066          9.179        325.581              0
150     84,993.500          5.745         18.792         29.966          9.190        323.914              0
180     85,011.500          5.828         17.269         25.444          9.217        352.495              0
210     85,005.200          5.761         18.514         32.899          9.244        338.353              0
240     84,983.900          5.756         20.546         33.374          9.165        346.788              0
270     85,018.133          5.516         17.138         32.915          9.206        404.615              0

1 worker

master (ab7b4ca)

(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,667.633         96.401        944.767        972.030          2.220        115.121              0
 30     85,012.833          6.684         21.283         27.427          2.616         27.433              0
 60     85,003.867          6.715         22.315         28.967          2.600         48.685              0
 90     85,009.633          7.003         24.855         30.261          2.650         56.965              0
120     85,008.167          6.765         22.331         35.750          2.651         75.872              0
150     84,997.767          6.788         22.430         31.998          2.597         99.166              0
180     85,004.633          6.658         21.905         26.755          2.574        123.478              0
210     85,011.633          6.661         21.070         26.460          2.573         34.217              0
240     84,961.500          6.658         21.955         29.606          2.593         38.743              0
270     85,062.533          6.715         22.790         28.492          2.597         76.703              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,666.067        100.076        956.301        968.884          2.289         90.811              0
 30     84,985.100          6.886         24.461         30.654          2.644         43.144              0
 60     85,033.667          6.738         21.725         30.786          2.613         44.536              0
 90     85,006.833          6.827         24.183         28.361          2.636        123.622              0
120     85,003.100          6.767         21.807         27.967          2.700        111.695              0
150     85,007.800          6.564         21.365         33.194          2.574        104.018              0
180     85,004.067          7.089         24.527         29.688          2.669         80.106              0
210     85,009.400          6.673         21.348         27.853          2.617         53.960              0
240     84,999.367          7.159         24.216         29.131          2.668        134.561              0
270     85,064.100          7.168         24.773         28.393          2.670        115.301              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,651.067        104.108        983.040        999.293          2.245         94.063              0
 30     82,287.774          7.086         23.364         43.221          2.574        106.583              0
 61     85,002.000          6.953         23.396         29.213          2.642        113.673              0
 91     85,013.500          6.913         22.839         29.393          2.628        129.253              0
121     85,008.667          6.775         22.348         31.982          2.650        153.746              0
151     85,003.467          6.576         19.956         27.017          2.560         56.378              0
181     85,015.300          6.837         22.692         31.408          2.607         79.616              0
211     85,004.100          6.879         25.346         31.097          2.581         94.896              0
241     85,005.867          6.891         23.609         29.278          2.594        116.510              0
271     85,010.800          6.760         21.987         28.541          2.575        125.168              0

STORM-2306 (5b54809)

(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,666.333         18.022        330.564        346.030          2.079         46.405              0
 30     85,017.400          3.748         20.791         24.805          2.686        107.791              0
 60     85,020.833          3.466         20.120         24.068          2.679         46.481              0
 90     85,009.833          3.470         19.988         23.118          2.639         63.486              0
120     85,007.600          3.676         21.250         26.542          2.708         76.022              0
150     85,006.733          3.395         20.283         23.904          2.636         80.490              0
180     85,009.333          3.632         21.086         26.231          2.657         78.360              0
210     85,003.300          3.643         20.840         26.362          2.670         87.437              0
240     85,007.733          3.735         21.545         25.788          2.686         98.075              0
270     85,008.000          3.675         21.430         29.606          2.647         93.264              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,684.100         15.841        314.835        371.196          2.051         52.854              0
 30     84,998.900          3.343         20.464         24.134          2.624         95.248              0
 60     85,014.100          3.600         21.299         24.363          2.665         43.992              0
 90     85,000.533          3.539         20.726         23.839          2.650        100.354              0
120     85,006.567          3.483         20.251         23.347          2.665         40.798              0
150     84,992.467          3.562         20.791         26.001          2.666        102.680              0
180     82,297.839          3.655         20.890         27.378          2.590         51.539              0
211     85,007.333          3.567         21.299         26.640          2.650        107.193              0
241     85,012.467          3.604         20.955         27.460          2.646         50.419              0
271     85,001.333          3.288         19.726         24.543          2.604        103.526              0
(s)  rate(tuple/s)       mean(ms)     99%ile(ms)   99.9%ile(ms)          cores        mem(MB)         failed
  0     56,680.200         14.695        299.893        340.263          2.096        100.239              0
 30     85,012.833          4.007         21.512         27.427          2.719         67.345              0
 60     85,003.900          3.921         22.233         31.228          2.709         43.670              0
 90     85,009.467          3.881         22.249         26.722          2.683         23.378              0
120     85,027.600          3.955         21.840         25.772          2.717        108.810              0
150     85,009.300          4.049         22.479         36.405          2.724         80.150              0
180     85,005.933          3.381         20.283         23.478          2.639         43.224              0
210     85,007.733          3.798         21.053         24.199          2.717        115.814              0
240     85,007.800          4.275         22.266         26.608          2.751        106.709              0
270     85,005.867          3.507         20.644         24.297          2.700         59.038              0

In overall, this patch shows half of mean latency, whereas 99%ile/99.9%ile of latencies show less difference (not a kind of linear). It also shows this patch consumes more CPU. The gap is fairly small for single-worker but becomes somewhat huge on 4 workers. I might be wrong about testing so it would be really nice if someone also runs the multi-workers test and shares the result.

Even my test result is not wrong I'm +1, because this patch introduces better design of backpressure which should have been enabled by default but we disabled by default since it affected performance. We could file some follow-up issues (with priority to blocker if needed) if there're something we should address.

@HeartSaVioR HeartSaVioR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Thanks for the amazing contribution and also your patience.

@roshannaik

roshannaik commented Feb 14, 2018

Copy link
Copy Markdown
Contributor Author
  • Thanks for giving it a spin and posting the numbers. The higher CPU in multi-worker mode is not something I have seen before. Will take a look. Can you please share the cmd line that you used ? Were all 4 workers on same host ?
  • Plan is to rerun the suite that was previously published and see if any regressions were introduced due to recent changes and the rebasing .. which i think introduced about 300 or so commits since the last perf run. Will do this sometime soon.. perhaps when we are closer to beta release.
    -Side Note: If you run TVL again, do pay attention to the latency on the UI. TVLs report does not seem to be including the actual latency.

Will quash the commits and refresh this PR so that it can be committed.

@HeartSaVioR

HeartSaVioR commented Feb 14, 2018

Copy link
Copy Markdown
Contributor

Yes I only did the performance test for single node.

Script for running TVL:

You may not want to rely on latency on the UI, since it includes metrics while starting up which we would want to discard before numbers are stabilized. If you would want to pick up the numbers from UI, please read it at least after 15 mins later so that metrics regarding first 5 mins would be out of window for last 10 mins.

I'm also planning to share some scripts regarding verifying release, running daemons in a node via tmux/tmuxinator.

@roshannaik

Copy link
Copy Markdown
Contributor Author

Commits Quashed. Thanks. Will use follow up jiras to address any issues discovered.

@revans2

revans2 commented Feb 14, 2018

Copy link
Copy Markdown
Contributor

I want to clarify that my performance tests on the latest code were fairly simple. I did more exhaustive performance tests on an older version of the code that looked good to me, but I didn't save any of the numbers.

I am planning to merge this in shortly once I verify all of the unit tests still pass, but I think we should see if we can reproduce the increased CPU utilization that @HeartSaVioR saw in a follow on JIRA.

@asfgit
asfgit merged commit bc4c480 into apache:master Feb 14, 2018
asfgit pushed a commit that referenced this pull request Feb 14, 2018
…to STORM-2306

STORM-2306: Messaging subsystem redesign

This closes #2502
@roshannaik

Copy link
Copy Markdown
Contributor Author

Nice feeling for me to see this merged in and I will look into the CPU usage issue reported by @HeartSaVioR. Just Wanted to specifically call out and thank the following folks who have been very helpful in making this possible:
Sapin Amin, @harshach, @revans2 , @arunmahadevan, @HeartSaVioR and @satishd !

@harshach

Copy link
Copy Markdown
Contributor

Congrats @roshannaik great effort and perseverance to get this in and thanks to @revans2 for reviewing in great detail.

@roshannaik

Copy link
Copy Markdown
Contributor Author

@HeartSaVioR
I am not seeing the reported excessive CPU usage behavior for 4 workers. First I tried taking some runs on my mid 2015 macbook pro (single cpu socket). Since no issue was seen, i reran the same on a linux server (2 sockets, 6 physical cores per socket).

The below cmd was run.
{code}
bin/storm jar storm-loadgen-*.jar org.apache.storm.loadgen.ThroughputVsLatency --rate 85000 --spouts 4 --splitters 4 --counters 4 -c topology.max.spout.pending=5000 -c topology.workers=4
{code}

All runs were similar so just posting results from one run for each.

Mac Book Runs:

Master without 2306 (#ab7b4ca) [Latency from UI =240ms]

start(s) end(s) rate(tuple/s) mean(ms) 99%ile(ms) 99.9%ile(ms) cores mem(MB)
0 30 19,319.467 8,411.912 13,153.337 13,254.001 5.275 340.719
30 60 72,613.500 16,113.830 17,750.295 17,884.512 6.849 364.807
60 90 75,519.067 19,671.741 21,474.836 21,558.723 6.755 344.906
90 120 79,225.167 22,121.255 23,823.647 23,941.087 6.878 222.115
120 150 80,967.567 23,784.484 25,585.254 25,652.363 6.889 365.383
150 180 80,062.067 25,269.534 27,665.629 27,866.956 6.895 343.674
180 210 78,306.300 27,560.823 30,467.424 30,551.310 7.025 436.814
210 240 78,586.667 29,673.204 32,883.343 33,000.784 6.945 293.014
240 270 80,500.667 31,513.715 34,795.946 34,829.500 6.818 416.121
270 300 82,625.667 32,883.453 35,903.242 35,970.351 6.899 364.058

Master with 2306 (#09e0123) [Latency from UI =89ms]

start(s) end(s) rate(tuple/s) mean(ms) 99%ile(ms) 99.9%ile(ms) cores mem(MB)
0 30 19,607.100 8,127.475 14,277.411 14,772.339 4.861 330.486
30 60 85,946.533 12,737.708 18,471.715 18,589.155 6.587 418.567
60 90 91,256.133 12,276.112 17,901.289 18,001.953 6.527 229.531
90 120 95,317.967 9,204.098 14,529.069 14,612.955 6.552 432.803
120 150 97,220.233 5,221.476 9,865.003 10,125.050 6.551 169.757
150 180 92,499.200 984.904 4,213.178 4,546.626 6.746 280.883
180 210 79,557.700 1,059.939 2,619.343 2,766.143 6.155 430.853
210 240 79,766.467 2,336.027 5,158.994 5,347.738 6.238 288.708
240 270 81,595.800 4,284.723 7,377.781 7,528.776 6.258 315.524
270 300 88,294.067 5,024.767 8,422.162 8,493.466 6.412 263.682

Linux Server Runs:

Master without 2306 (#ab7b4ca) [Latency from UI =15ms]

start_time(s) end_time(s) rate(tuple/s) mean(ms) 99%ile(ms) 99.9%ile(ms) cores mem(MB)
0 30 56,704.80 1,194.20 3,867.15 3,978.30 11.294 978.701
30 60 85,001.70 12.018 21.479 26.837 11.931 897.105
60 90 85,007.17 11.84 21.152 26.345 11.575 950.129
90 120 85,008.13 11.781 20.447 24.986 11.688 882.768
120 150 85,009.57 11.841 21.021 25.592 11.735 921.339
150 180 84,997.60 11.763 20.791 25.199 11.476 961.395
180 210 85,005.57 11.824 20.66 25.281 11.798 1,000.03
210 240 85,008.00 11.75 20.611 25.706 11.354 1,120.33
240 271 82,259.16 11.916 20.955 25.117 11.517 939.918
271 301 85,003.57 11.719 20.398 24.822 11.322 980.654

Master with 2306 (#09e0123) [Latency from UI =7.8ms]

start_time(s) end_time(s) rate(tuple/s) mean(ms) 99%ile(ms) 99.9%ile(ms) cores mem(MB)
0 30 56,701.03 426.534 2,673.87 2,793.41 7.693 290.006
30 60 85,004.40 3.387 8.294 14.655 5.89 231.328
60 90 85,002.20 3.332 7.66 10.945 5.791 247.683
90 121 82,259.87 3.33 7.516 9.839 5.591 264.324
121 151 85,004.37 3.349 7.737 10.969 5.819 272.916
151 181 85,001.07 3.323 7.434 9.961 5.747 203.54
181 211 85,002.57 3.335 7.586 10.281 5.794 304.567
211 241 85,005.03 3.326 7.475 9.921 5.836 317.026
241 271 85,003.27 3.339 7.565 10.527 5.723 251.676
271 301 85,002.00 3.351 7.799 12.394 5.716 377.182

Summary:

On Linux Both CPU and mem usage was significantly better for 2306.
Actual latency (taken from UI) was also much better for 2306.

On Macbook: Both CPU & mem usage were relatively close but slightly favoring 2306. Again, the actual latency was much better for 2306.

@HeartSaVioR

Copy link
Copy Markdown
Contributor

@roshannaik
Hmm... OK. Interesting result. Since you're planning to refresh numbers in doc before Storm 2.0.0, so we can revisit the number to see whether there's odd result shown or not.

FYI my desktop spec and OS here:

OS: Ubuntu 17.10, 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 x86_64 x86_64
CPU: AMD Ryzen 5 1600 3.2Ghz 6 core (with hyper-thread = 12 logical cores)
RAM: Samsung DDR4 32G 19200
SSD: Samsung 850 Evo

@roshannaik

Copy link
Copy Markdown
Contributor Author

I suspect this issue won’t show up on the setups I am using and will need to be triaged on your setup itself. Will work with you offline on that.

BTW what version of Java are you using ?

@Ethanlm

Ethanlm commented Feb 26, 2018

Copy link
Copy Markdown
Contributor

Hi, thanks for the great patch.

But I ran into some problems.

I ran

bin/storm jar storm-loadgen-*.jar org.apache.storm.loadgen.ThroughputVsLatency --spouts 1 --splitters 2 --counters 1 -c topology.debug=true

on ResourceAwareScheduler and it's not working properly.

It looks like the __acker-executor was not able to receive messages from spouts and bolts. And spouts and bolts continued to retry sending messages to acker. It then led to another problem:
https://issues.apache.org/jira/browse/STORM-2970

I tried to run on the storm right before this merge and it works properly. I then tried to run it on the storm right after this merge and this issue appears.

Could you please verify? Thanks!

@roshannaik

Copy link
Copy Markdown
Contributor Author

@Ethanlm should be able to take a look in a couple days. can you share any settings you are using outside in config file other than the one you noted on the cmd line (toplogy.debug=true) ? esp RAS related.

@Ethanlm

Ethanlm commented Feb 27, 2018

Copy link
Copy Markdown
Contributor

@roshannaik Thanks for looking into this. I used default configs on secure cluster with ResourceAwareScheduler.

@roshannaik

Copy link
Copy Markdown
Contributor Author

Not very familiar with RAS and how it works ..... it seems to be default enabled ... Can you elaborate what setup was needed for RAS (if any) in your case ?

@Ethanlm

Ethanlm commented Feb 27, 2018

Copy link
Copy Markdown
Contributor

Yes sure. My storm.yaml is as follows:

storm.zookeeper.servers:
     - "persistmist.corp.ne1.yahoo.com"

nimbus.seeds: ["persistmist.corp.ne1.yahoo.com", "localhost"]

storm.local.dir: "/tmp/apache-storm-2.0.0-SNAPSHOT/storm-local"
supervisor.run.worker.as.user: true
supervisor.worker.launcher: /etc/storm/worker-launcher
nimbus.authorizer: "org.apache.storm.security.auth.authorizer.SimpleACLAuthorizer"
nimbus.supervisor.users:
   - "mapredqa"
nimbus.admins:
   - "mapredqa"
   - "ethan"
nimbus.users:
   - "mapredqa"
   - "ethan"
ui.users:
   - "mapredqa"
   - "ethan"
logs.users:
   - "mapredqa"
   - "ethan"

storm.thrift.transport: "org.apache.storm.security.auth.kerberos.KerberosSaslTransportPlugin"
java.security.auth.login.config: "/jaas/storm_jaas.conf"

nimbus.childopts: "-Xmx1024m -Djava.security.auth.login.config=/jaas/storm_jaas.conf " # " -Dsun.security.krb5.debug=true"
ui.childopts: "-Xmx768m -Djava.security.auth.login.config=/jaas/storm_jaas.conf" # -Dsun.security.krb5.debug=true"
supervisor.childopts: "-Xmx256m -Djava.security.auth.login.config=/jaas/storm_jaas.conf"

storm.principal.tolocal: "org.apache.storm.security.auth.KerberosPrincipalToLocal"
storm.zookeeper.superACL: "sasl:mapredqa"
storm.blobstore.acl.validation.enabled: false
ui.header.buffer.bytes: 65536
ui.filter: "org.apache.hadoop.security.authentication.server.AuthenticationFilter"
ui.filter.params:
   "type": "kerberos"
   "kerberos.principal": "HTTP/persistmist.corp.ne1.yahoo.com"
   "kerberos.keytab": "/keytabs/HTTP.keytab"
   "kerberos.name.rules": "DEFAULT"
scheduler.display.resource: true
storm.scheduler: "org.apache.storm.scheduler.resource.ResourceAwareScheduler"

@roshannaik

Copy link
Copy Markdown
Contributor Author

@Ethanlm can you please open a jira for this issue ?

@Ethanlm

Ethanlm commented Feb 28, 2018

Copy link
Copy Markdown
Contributor

@roshannaik Yes sure. https://issues.apache.org/jira/browse/STORM-2983 This blocks my current work and I would really appreciate it if it can be solved soon. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants