Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EPIC] v1 data path performance enhancement #6600

Open
derekbit opened this issue Aug 28, 2023 · 8 comments
Open

[EPIC] v1 data path performance enhancement #6600

derekbit opened this issue Aug 28, 2023 · 8 comments
Assignees
Labels
area/edge Edge related area/environment-low-spec Use low spec hardware resources like HDD for longhorn disk area/replica Volume replica where data is placed area/v1-data-engine v1 data engine (iSCSI tgt) Epic highlight Important feature/issue to highlight kind/feature Feature request, new feature priority/0 Must be fixed in this release (managed by PO)
Milestone

Comments

@derekbit
Copy link
Member

derekbit commented Aug 28, 2023

Is your feature request related to a problem? Please describe (馃憤 if you like this request)

This epic is used to track improvements of the v1 data path.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

cc @longhorn/dev-data-plane

@derekbit derekbit added kind/feature Feature request, new feature Epic labels Aug 28, 2023
@innobead
Copy link
Member

innobead commented Aug 28, 2023

The primary improvement would be:

  • frontend <-> engine: introduce ublk (relying on kernel support, at least 6.1)
  • engine/replica <-> replica: introduce a new protocol (like quic) to replace the in-house TCP-based protocol.

The purpose is to make v1 appropriate for running under constrained resource environments like Edge.

@innobead innobead added this to the v1.7.0 milestone Aug 28, 2023
@innobead innobead added highlight Important feature/issue to highlight priority/0 Must be fixed in this release (managed by PO) area/v1-data-engine v1 data engine (iSCSI tgt) area/replica Volume replica where data is placed area/edge Edge related labels Aug 28, 2023
@innobead innobead modified the milestones: v1.7.0, v1.8.0 Feb 26, 2024
@innobead innobead added the area/environment-low-spec Use low spec hardware resources like HDD for longhorn disk label Feb 27, 2024
@derekbit
Copy link
Member Author

derekbit commented Apr 30, 2024

@Kampadais improved the v1 data path based on my previous PoC.
longhorn/longhorn-engine#1067

I think we can work on the improvement in v1.8.0 together and replace the iSCSI frontend with the new one.
WDYT @PhanLe1010 @Kampadais

cc @innobead

@PhanLe1010
Copy link
Contributor

PhanLe1010 commented Apr 30, 2024

Agree that we can implement it in 1.8.0. Because I am working on v1 performance related topics, I can help to drive this ticket if it is ok Derek

@derekbit
Copy link
Member Author

Agree that we can implement it in 1.8.0. Because I am working on v1 performance related topics, I can help to drive this ticket if it is ok Derek

Sure! ;) BTW, the author of ubdsrv, Ming, is friendly and interested in Longhorn. Feel free to discuss with him if we encounter any issues.

@Kampadais
Copy link

I would like to work on it more. I am currently experimenting and investigating why with my multiple connections approach can't achieve ublk's performance.

@PhanLe1010
Copy link
Contributor

Surely @Kampadais . I am happy to follow your lead!

@shuo-wu
Copy link
Contributor

shuo-wu commented May 3, 2024

Recently Phan and me tried to make some improvements to the v1 backend data path:

  1. Avoid unnecessary memory allocations during revision counter increment (for Write operation): Fix some v1 data path bottlenecks聽longhorn-engine#1085
  2. Increase the connection between engine and replicas: Fix some v1 data path bottlenecks聽longhorn-engine#1085
  3. Cache the disk size so that there is no need to invoke system call fstat for each Read operation: [IMPROVEMENT] Investigate performance bottleneck in v1 data path 聽#8436 (comment)
  4. Use channels rather than mutex lock for revision counter increment
  5. Increase the revision counter and write actual data simultaneously

Notice that only the first two ideas work as expected. And the remaining 3 ideas cannot get a better result in the fio test, regardless that the CPU profiling shows a CPU usage percentage decrement for the R/W function. We suspect that iSCSI tgt may be the main bottleneck. It may waste all CPU resources saved by the last 3 ideas, which finally leads to 0 improvements in the fio test.

If we plan to introduce ublk or other kinds of frontend, which has better improvement than iSCSI tgt. We can re-do the test for the last 3 ideas. For example:

               ublk + idea 1,2            ublk + idea 1,2,3            ublk + idea 1,2,3,4,5
IOPS
CPU

cc @PhanLe1010

@DamiaSan
Copy link
Contributor

DamiaSan commented May 3, 2024

Maybe the bottleneck can be the revision counter itself? I mean the writing of the revision counter on the disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/edge Edge related area/environment-low-spec Use low spec hardware resources like HDD for longhorn disk area/replica Volume replica where data is placed area/v1-data-engine v1 data engine (iSCSI tgt) Epic highlight Important feature/issue to highlight kind/feature Feature request, new feature priority/0 Must be fixed in this release (managed by PO)
Projects
None yet
Development

No branches or pull requests

6 participants