Commit Graph

53 Commits

Author SHA1 Message Date
Ivan Kozlovic
7ab9c76f2b Fixed benchmark tests to be able to run with Go 1.13+
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-02-26 12:12:18 -07:00
Derek Collison
ffc3c0da70 Fixed #1144, qsub performance improvements
Signed-off-by: Derek Collison <derek@nats.io>
2019-12-09 22:08:59 +01:00
Ivan Kozlovic
ae99fc3a2a Fixed issues reported by staticcheck
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-12-04 17:04:58 -07:00
Ivan Kozlovic
aa843945c9 Work on Gateways reply mapping
- New prefix that includes origin server for the request
- Mapping done if request is service import or requestor has
  recent subscription
- Subscription considered recent if less than 250ms
- Destination server strip GW prefix before giving to client
  and restore when getting a reply on that subject
- Mapping removed aftert 250ms
- Server rejects client publish on "$GNR." (the new prefix)
- Cluster and server hash are now 8 chars long and from base 62
  alphabets
- Mapped replies need to be sent to leafnode servers due to race
  (cluster B sends RS+ on GW inbound then RMSG on outbound, the
  RS+ may be processed later and cluster A may have given message
  to LN before RS+ on reply subject. So LN needs to accept the
  mapped reply but will strip to give to client and reassemble
  before sending it back)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-11-06 16:06:49 -07:00
Derek Collison
8a69c5cb71 Updates to benchmarks
Allow disabling of short first ping timer for clients.
Adjust names so that full test suite results are aligned.
Removed the account lookup, we use sync.Map but also a no-lock cache.

Signed-off-by: Derek Collison <derek@nats.io>
2019-11-02 08:04:22 -07:00
Ivan Kozlovic
2a8973a62b Fixed flushOutbound
With Go 1.12 (strangely was not able to reproduce with Go 1.11)
the test TestRouteNoCrashOnAddingSubToRoute() would frequently
locks up and consume all avail CPUs on the machine. Running
this test with GOMAXPROCS=2 you would see server.test CPU usage
pegged at 200% (assuming you have at least 2 CPUs).
The reason was that the writeLoop was spinning because another
routine was already in flushOutbound() and stack trace would
show that it was stuck in system calls. It seems that even though
the writeLoop does release the lock but grab it right away was
not allowing the syscall to complete.

So decided to put back the unlock/gosched/lock back in flushOutbound()
when flag is already set, but then protect the closeConnection()
with its own flag (similar to clearConnection) to not re-introduce
issue fixed in #1092.

Had to fix the benchmark test RoutedInterestGraph because after a
route is accepted, the initial PING will be sent after 1sec which
was breaking this test.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-29 12:59:27 -06:00
Ivan Kozlovic
ed1901c792 Update go.mod to satisfy v2 requirements
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-03 19:45:47 -06:00
Derek Collison
acfe372d63 Changes for rename from gnatsd -> nats-server
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:04:24 -07:00
Derek Collison
1a6c9819f3 Added account export/import benchmark
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-26 12:03:00 -07:00
Derek Collison
f320f318b7 Fixed merge conflict
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-23 17:28:42 -07:00
Derek Collison
bfe83aff81 Make account lookup faster with sync.Map
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-23 17:13:23 -07:00
Ivan Kozlovic
9f497a6cd4 Revert to use Sublist but use the SublistNoCache version.
Remove sub from rsubs sublist when user UNSUBs.

Fix bench test that was not actually creating a SUB per request
in the Benchmark_Gateways_Requests_CreateOneSubForEach test.
Also UNSUBs older SUBs after a certain threshold to simulate
actual req/reply.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-23 14:13:13 -06:00
Ivan Kozlovic
bb4e8ae0f9 Gateways: Fix race for request reply
This addresses the following race:
- client connection creates a subscription on a reply subject
- client connection sends a request
- server sends the subscription to inbound gateway
- server sends the message to outbound gateway (those may be
  to different servers)
- receiving server sends to sub interested in request subject
- app sends reply
- its server then check for interest on the reply's subject

In interestOnly mode, there is a possibility that this server
has not received the interest on the reply subject yet and would
then drop the reply.

This PR detects above scenario and will prefix the reply subject
to identify the origin cluster if it is detected that the last
subscription from the sending connection was created less than
a second ago.
Once the destination has this prefix, the destination cluster
will always send back that message to origin cluster even if
there is no registered interest.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-22 20:00:21 -06:00
Ivan Kozlovic
ba748302c4 Gateways: some optimizations
Check sublist only when required.
Send the subs list in place instead of go routine (gateways have
different outbound/inbound connections so they don't suffer same
issue than routes)
Bump the default array size when collecting gateway connections

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-02-28 11:16:05 -07:00
Derek Collison
e3d19ef698 Changes to prevent fan in scenarios from slow consumer state
Signed-off-by: Derek Collison <derek@nats.io>
2019-01-10 15:56:04 -08:00
Derek Collison
24b99c74a3 Optimize subs over routes
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-12 08:06:10 -08:00
Derek Collison
1ce1a434b0 Fix for #792
Allow deny clauses for subscriptions to still allow wildcard subscriptions but do not deliver the messages themselves.

Signed-off-by: Derek Collison <derek@nats.io>
2018-11-06 15:00:21 -08:00
Derek Collison
3b953ce838 Allow localhost to not be defined, only need 127.0.0.1
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-28 16:10:19 -07:00
Derek Collison
844f376140 Performance optimizations, beta3, fixes to various tests.
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-11 15:11:03 -07:00
Derek Collison
e9178f1f42 Performance tweaks
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
644376209b Added large payload pub/sub benchmark
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
bb292d9a8d Re-enable benchmark tests
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
e1ce792e41 Change to timer setup
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
b9c73e96ee Changed sublist to avoid quadratic time in removal with large N
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-04 17:45:05 -07:00
Derek Collison
e6f200b698 Baseline order test and benchmarks 2018-06-04 17:45:05 -07:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Ivan Kozlovic
ad1605fb96 Added benchmark for routed queues 2018-03-09 17:49:10 -07:00
Derek Collison
c7e699ac29 Updated benchmark formatting, added 128b payload 2016-08-24 13:17:07 -07:00
Ivan Kozlovic
c6d37ecf8f [IMPROVED] Route performance for larger messages 2016-08-01 19:01:34 -06:00
Derek Collison
7730fac9e2 Authorization enforcement and performance tweaks 2016-06-16 17:07:25 -07:00
Derek Collison
27ac524daf version bump to next beta 2016-06-15 11:10:50 -07:00
Derek Collison
907c226849 remove alloc tracking 2016-02-05 07:50:19 -08:00
Derek Collison
2fcdebc34d formatting 2016-02-05 07:36:48 -08:00
Derek Collison
661238eb1a Add 8 subscriber queue benchmark 2016-02-05 07:34:21 -08:00
Derek Collison
075529e2fe Properly handle and enforce max payload 2015-08-05 22:05:58 -07:00
Derek Collison
96acffdc35 Updated copyright, removed commented imports 2015-07-14 10:57:57 -07:00
Derek Collison
90d1d6d572 Much improved large message performance 2015-06-25 13:51:53 -07:00
Derek Collison
96bab33075 fixed import paths 2015-06-19 12:08:11 -07:00
Derek Collison
c0daceed68 raise timeouts 2015-06-15 13:02:55 -07:00
Derek Collison
eb5c550f10 Fixed slice panic on MSG_ARG split buffer 2013-12-12 13:11:37 -08:00
Derek Collison
71c0c28ced copyright hygiene 2013-10-16 13:40:15 -07:00
Derek Collison
4e1502cc4c README license, copyright cleanup, etc 2013-09-30 10:16:43 -07:00
Derek Collison
1d4e02fe32 Upped read timeout, made certain errors fatal 2013-08-19 12:33:45 -07:00
Derek Collison
cb6a71fb46 Move to Go routine server vs external 2013-08-16 07:45:13 -07:00
Derek Collison
975b54195a Use go routine server 2013-08-15 17:03:44 -07:00
Derek Collison
cf0f30200f log file support, data race fixes 2013-08-02 16:52:54 -07:00
Derek Collison
19a9b07b4d Fixup tests for changes to export functions 2013-07-17 09:22:22 -05:00
Derek Collison
4497f2c711 More reasonable payload sizes for pub tests 2012-12-19 17:44:59 -08:00
Derek Collison
dba60fe071 Added StartTimer to setup payload 2012-12-13 17:10:12 -08:00
Derek Collison
2968ea1538 auth support, cleanup 2012-12-05 16:59:48 -08:00