Why is my performance so low with Aeron, 90th percentile less than 5ms throughput is only 2k

I wrote a simple test for Aeron
one client, one server, the client sends data to the server, then the server sends it back and counts the elapsed time.
The final result is much lower than I expected, the following is part of my code and configuration, and some monitoring data

client publication

// client publication
    @Scheduled(fixedRate = 1000)
    private void start() {
        if (!publishTaskEnable) {
            return;
        }

        ConcurrentPublication publication = aeron.addPublication(
                aeronProperties.getClient().getPublication().getChannel(),
                aeronProperties.getClient().getPublication().getStream());
        while (!publication.isConnected()) {
            try {
                TimeUnit.MILLISECONDS.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        AtomicLong counter = new AtomicLong(0);
        LongStream.range(0, aeronProperties.getRound()).forEach(i -> publish(publication, counter));
    }

    private void publish(Publication publication, AtomicLong counter) {
        UnsafeBuffer buffer = new UnsafeBuffer(BufferUtil.allocateDirectAligned(16, 8));
        long count = counter.incrementAndGet();
        buffer.putLong(0, count);
        publication.offer(buffer, 0, 16);
        startTimeMap.put(count, System.currentTimeMillis());
    }

client subscribe

    @SneakyThrows
    public void receive(String channel, Integer stream) {

        clientPublication.setAeron(Aeron.connect(new Aeron.Context()
                .aeronDirectoryName(aeronProperties.getDirname())
                .idleStrategy(new NoOpIdleStrategy())));
        try (Subscription subscription = clientPublication.getAeron().addSubscription(channel, stream)) {
            IdleStrategy idleStrategy = new BusySpinIdleStrategy();
            FragmentHandler fragmentHandler = this::onMessage;
            while (true) {
                int fragmentsRead = subscription.poll(fragmentHandler, 1000);
                idleStrategy.idle(fragmentsRead);
            }
        }
    }

    @SneakyThrows
    public void onMessage(DirectBuffer buffer, int offset, int length, Header header) {
        long data = buffer.getLong(offset);
        Long startTime = clientPublication.getStartTimeMap().get(data);
        if (startTime == null) {
            return;
        }
        long interval = System.currentTimeMillis() - startTime;
        clientPublication.getTimeList().add(interval);
        clientPublication.getStartTimeMap().remove(data);
    }

Media Driver

java  --add-opens=java.base/sun.nio.ch=ALL-UNNAMED 
       -XX:+UseBiasedLocking 
       -XX:BiasedLockingStartupDelay=0 
       -XX:+UnlockExperimentalVMOptions 
       -XX:+UseParallelGC 
       -XX:+TrustFinalNonStaticFields 
       -XX:+UnlockDiagnosticVMOptions 
       -XX:GuaranteedSafepointInterval=300000 
       -Djava.net.preferIPv4Stack=true 
       -Daeron.dir=$AERON_DIR 
       -Daeron.threading.mode=DEDICATED 
       -Daeron.conductor.idle.strategy=org.agrona.concurrent.BusySpinIdleStrategy 
       -Daeron.sender.idle.strategy=org.agrona.concurrent.NoOpIdleStrategy 
       -Daeron.receiver.idle.strategy=org.agrona.concurrent.NoOpIdleStrategy 
       -Daeron.term.buffer.length=16M 
       -Daeron.socket.so_sndbuf=2m 
       -Daeron.socket.so_rcvbuf=2m 
       -Daeron.rcv.initial.window.length=2m 
       -Dagrona.disable.bounds.checks=true 
       -Daeron.pre.touch.mapped.memory=true 
       -cp aeron-all-1.44.1.jar io.aeron.driver.MediaDriver

below is some monitor data

iostat -sxz 1
Linux 5.15.0-112-generic (VM-0-2-ubuntu)    06/23/2024  _x86_64_    (8 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          20.43    0.01    5.24    0.13    0.00   74.19

Device             tps      kB/s    rqm/s   await  areq-sz  aqu-sz  %util
loop0             0.02      0.15     0.00    0.98     7.33    0.00   0.00
loop1             0.02      0.15     0.00    1.16     8.05    0.00   0.00
loop2             0.09      0.92     0.00    0.66    10.14    0.00   0.01
loop3             0.02      0.46     0.00    1.04    21.18    0.00   0.00
loop4             0.03      0.47     0.00    1.23    15.56    0.00   0.00
loop5             0.02      0.15     0.00    1.00     8.39    0.00   0.00
loop6             0.81     31.72     0.00    0.22    39.30    0.00   0.27
loop7             0.01      0.01     0.00    0.00     1.36    0.00   0.00
sr0               1.54     54.31     0.00    0.24    35.33    0.00   0.05
vda              15.58    418.32    12.74    1.85    26.85    0.03   1.44


sar -n UDP 1
Linux 5.15.0-112-generic (VM-0-2-ubuntu)    06/23/2024  _x86_64_    (8 CPU)

02:18:57 PM    idgm/s    odgm/s  noport/s idgmerr/s
02:18:58 PM   7436.00    303.00      0.00      0.00
02:18:59 PM  14266.00    482.00      0.00      0.00
02:19:00 PM  18488.00    151.00      0.00      0.00
02:19:01 PM  13230.00    149.00      0.00      0.00
02:19:02 PM  16710.00    153.00      0.00      0.00
02:19:03 PM  15754.00    173.00      0.00      0.00

pidstat -t -r -p 4517
Linux 5.15.0-112-generic (VM-0-2-ubuntu)    06/23/2024  _x86_64_    (8 CPU)

01:47:56 PM   UID      TGID       TID  minflt/s  majflt/s     VSZ     RSS   %MEM  Command
01:47:56 PM  1000      4517         -     18.98      0.01  661284  111056   0.70  aeronmd
01:47:56 PM  1000         -      4517     18.98      0.01  661284  111056   0.70  |__aeronmd
01:47:56 PM  1000         -      4518      0.00      0.00  661284  111056   0.70  |__aeron_executor
01:47:56 PM  1000         -      4519      0.00      0.00  661284  111056   0.70  |__sender
01:47:56 PM  1000         -      4520      0.00      0.00  661284  111056   0.70  |__receiver

Is there something wrong? How can I optimize it?

I keep trying various parameters, but it doesn’t work very well.

New contributor

litchi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật