Aeron offers efficient reliable UDP unicast, UDP multicast, and IPC message transport — with a core design goal of reaching the highest throughput with the lowest and most predictable latency of any messaging system. Aeron Archive allows message streams to be recorded to persistent storage for later, or real-time, replay. Aeron Cluster provides fault-tolerant total ordering across multiple streams.
components
- aeron
- aeron archive
- aeron cluster
- agrona
- SBE
- header.wrap(buffer, offset)
- request.wrap(buffer, offset + headerLentgh, actingLength, actingVersion)
agrona
- duty cycles
- business logic
- connectivity
- Agent
- Agrona Agents are containers for application logic that execute in a duty cycle, such as processing messages from an Aeron subscription.
- IdleStrategy
- Sleeping
- SleepingMillis
- Yielding
- Backoff
- NoOp
- BusySpin
what is this
Aeron
core components
- driver conductor: cordinator/dispatcher, accept and process the command from publication/subscription
- client conductor: resides in user app, communicate with driver conductor (IPC Ring/Broadcase Buffers)
- sender/receiver: communicate with media (IPC, UDP)
file system
media driver owns a folder exclusively (MMAP), real data resides in memory usually
- blank.template – empty template, to create new publication
- cnc.dat – command and control data
- images: any open images of remote publications
- loss-report.dat: packet loss report (LossState)
- publications: log buffer
- three equal sized sections - each a Term with a unique Term ID - which hold header and message data
- a metadata section, which resides at the end of the file
thread models
- dedicated – isolated thread for each sender, receiver, conductor
- shared network – one thread for sender, receiver, one for conducor
- shared – only one thread
- invoker – no thread, controlled by caller
channel stream
pub/sub needs to specify channel and stream-id.
|
|
publication
- offer – byteBuf -> log-buffer
- tryClaim – use pre-defined log-buffer, spare memory copy (doesn’t support fragmentation)
- commit
back pressure
- increase the size of log buffer (no more than 1G)
- decrease the size of sending data
- aeron archive for persistence
- send less data
- figure out io bottleneck
subscription – (controlled)fragmentHandler
log buffers & images
log buffer is memory mapped file in aeron, contains three identical memory space (term | clean,active,dirty) with different termId; and an area for maintaining metadata in the file end.
each publication has its own log-buffer.
position
- streamId
- sessionId
- termId
- termOffset
Aeron Archive
- Aeron Archive, which resides on the process persisting and replaying streams
- Aeron Archive Client, which resides on the process receiving archived streams.
|
|
Aeron Cluster
- consensus module
- memberId
- members
- archive ctx
- replication channel
- consensus channel
- ingress channel
- egress channel
- clustered service container
- clustered service
best practice
/dev/shm
is a temporary file storage (also known as a RAM-backed filesystem) on Linux systems. The “shm” stands for shared memory, and it is a special type of filesystem that allows applications to store and share data in memory, rather than on disk. It uses the tmpfs filesystem type, which resides in the system’s RAM, providing faster access compared to disk-based filesystems.
other suggestion
to run cookbook
remove AZUL requirement in gradle configuration.