Repository navigation
ARTEMIS-6355 perf client uses the wall clock of the other perf commands, and a negative latency no longer throws out of onMessage - #6873
Conversation
…ds, and a negative latency no longer throws out of onMessage
|
I understand the change.. but I believe perf client is not supposed to run in parallel with producer and consumer, right? Also: the new storage I'm working on will highly benefit from parallel queues, parallel producers... we should find a way to measure that. |
|
Not in parallel, no. It was sequential: If you don't want to support that mix, the negative latency handling still seems worth having: wall clocks can differ between hosts, so For parallel queues and producers, the connection tests I posted on #6838 are one way to measure it: |
|
I'm not sure about this change for a few reasons. Switching perf-client to the wall clock time source (default millisecond without-flags) when it is always expected to be sending to itself, now essentially requires all users interested in latency to set the opens flag to get access to the microsecond clock source for more useful latency results unlike before, which would potentially still not be as good as what it was using by default prior to the change, and is subject to changing backwards and causing 'negative latency' unlike before this change. It seems more useful to users by default, the way it was. Allowing mixing previously-sent messages from perf producer with subsequent consumption by perf client on the same queue, does not seem like it generally makes sense anyway, particularly for latency as the latency reported would all be entirely skewed by the execution gap. The idea of having the distinct client / consumer+producer commands is essentially to use one or the other. Negative latency seems like an error or problem worth at least flagging rather than silently ignoring, to make clear the results are bogus. If just saying it is 0 instead is then actually used as an effective 0 result, that will mean the latency result is really just incorrect anyway. |
|
Thanks Robbie. On the third point I agree: clamping to 0 hides a bad result. I'm happy to follow up so a negative latency isn't recorded but counted, with the summary warning that the latency results are invalid. On the clock, two things. The That said, I take the point that the wall clock can step back where |
|
Yep, I realise nanotime is only useful inside a single JVM. I dont think thats a problem since messages from perf client are themselves really only useful in a single execution, for much the same reason it typically wouldnt make sense to combine perf producer and perf client usage on the same messages between executions. I hadnt realised that the utility profile set the opens flag, which I guess somewhat negates that usability issue, at least for 'broker instance' usage (at least until such time as we ever stop doing that or it isnt allowed in future) but not the 'non instance' case. It does still seem worse that perf client is subject to wall clock change when it wasnt before, and that 'no instance' usage of perf client would start dropping to ms precision. I think I'd prefer to put it back to nanoTime as it was. |
|
Fair enough, thanks. I've opened #6909, which puts |
perf clientstamps and reads message times withSystem.nanoTime(), whileperf producerandperf consumeruse theMicrosClockwall clock. Whenperf clientconsumes messages sent byperf producer, the latency comes out negative, the histogram throws out ofonMessage, and the message is redelivered. The run stalls and never ends.All three commands now take their clock from
MicrosClock.timeProvider, including the fallback and its warning. It has to be the wall clock, as it's the only one that means anything across processes.perf clientlatencies are therefore measured on the wall clock now, like those of the other two commands.Wall clocks can still differ between hosts or step back, so a negative latency is now recorded as 0 instead of throwing, for the receive latency and for the send latency.
MessageListenerBenchmarkTestchecks a message stamped ahead of the receiver's clock and one stamped behind it. The first fails without the fix, withHistogram recorded value cannot be negative.Tested against a broker built from main, changing only the CLI jar, with 100000 messages sent by
perf producer --persistent --message-count 100000, thenperf client --persistent --duration 20 --warmup 5on the same queue:https://issues.apache.org/jira/browse/ARTEMIS-6355