mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Optimizations to reduce contention for high connections in a JetStream enabled account with high API usage.
Several strategies which are listed below. 1. Checking a RaftNode to see if it is the leader now uses atomics. 2. Checking if we are the JetStream meta leader from the server now uses an atomic. 3. Accessing the JetStream context no longer requires a server lock, uses atomic.Pointer. 4. Filestore syncBlocks would hold msgBlock locks during sync, now does not. Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -875,7 +875,7 @@ func (s *Server) sendStatsz(subj string) {
|
||||
m.Stats.ActiveServers = len(s.sys.servers) + 1
|
||||
|
||||
// JetStream
|
||||
if js := s.js; js != nil {
|
||||
if js := s.js.Load(); js != nil {
|
||||
jStat := &JetStreamVarz{}
|
||||
s.mu.RUnlock()
|
||||
js.mu.RLock()
|
||||
|
||||
Reference in New Issue
Block a user