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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ThreadPoolExecutor instead of EventLoop #8208

Merged
merged 5 commits into from
Oct 14, 2020

Conversation

315157973
Copy link
Contributor

Motivation

When Netty's EventLoop receives a new task,it will call eventFdWrite, and then trigger system calls, such as: system_call_fastpath, eventfd_write
After we replaced EventLoop with a native jdk thread pool, the performance improved

Modifications

Use ThreadPoolExecutor instead of EventLoop

Verifying this change

We use pulsar perf for testing
before:
Aggregated throughput stats --- 11715556 records received --- 68813.420 msg/s --- 537.605 Mbit/s

after:
Aggregated throughput stats --- 18392800 records received --- 133314.602 msg/s --- 1041.520 Mbit/s

@eolivelli
Copy link
Contributor

Is there any other ConsumerXX class that needs this change ?

@315157973
Copy link
Contributor Author

Is there any other ConsumerXX class that needs this change ?

If this PR is accepted, I will continue to modify other ConsumerXX :)

@sijie
Copy link
Member

sijie commented Oct 6, 2020

@315157973 how did you do the test? We'd prefer you to attach the details on how you run the perf test. This would give the context for the reviewers to review this change.

@aahmed-se
Copy link
Contributor

@315157973 can you provide more details on the setup you used to get theses perf numbers.

@315157973
Copy link
Contributor Author

Hello, I have already replied in another pr, refer to #8207

@codelipenghui codelipenghui added this to the 2.7.0 milestone Oct 7, 2020
…arClientImpl.java

Co-authored-by: lipenghui <penghui@apache.org>
@315157973
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor

@315157973 Please fix the conflicts.

@315157973
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 3a298f3 into apache:master Oct 14, 2020
wolfstudy pushed a commit that referenced this pull request Oct 30, 2020
### Motivation
When Netty's `EventLoop` receives a new task,it will call `eventFdWrite`, and then trigger system calls, such as: system_call_fastpath, eventfd_write
After we replaced EventLoop with a native jdk thread pool, the performance improved

### Modifications
Use ThreadPoolExecutor instead of EventLoop

### Verifying this change
We use pulsar perf for testing
before:
Aggregated throughput stats --- 11715556 records received --- 68813.420 msg/s --- 537.605 Mbit/s

after:
Aggregated throughput stats --- 18392800 records received --- 133314.602 msg/s --- 1041.520 Mbit/s

(cherry picked from commit 3a298f3)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Nov 13, 2020
### Motivation
When Netty's `EventLoop` receives a new task,it will call `eventFdWrite`, and then trigger system calls, such as: system_call_fastpath, eventfd_write
After we replaced EventLoop with a native jdk thread pool, the performance improved

### Modifications
Use ThreadPoolExecutor instead of EventLoop

### Verifying this change
We use pulsar perf for testing
before:
Aggregated throughput stats --- 11715556 records received --- 68813.420 msg/s --- 537.605 Mbit/s

after:
Aggregated throughput stats --- 18392800 records received --- 133314.602 msg/s --- 1041.520 Mbit/s
flowchartsman pushed a commit to flowchartsman/pulsar that referenced this pull request Nov 17, 2020
### Motivation
When Netty's `EventLoop` receives a new task,it will call `eventFdWrite`, and then trigger system calls, such as: system_call_fastpath, eventfd_write
After we replaced EventLoop with a native jdk thread pool, the performance improved

### Modifications
Use ThreadPoolExecutor instead of EventLoop

### Verifying this change
We use pulsar perf for testing
before:
Aggregated throughput stats --- 11715556 records received --- 68813.420 msg/s --- 537.605 Mbit/s

after:
Aggregated throughput stats --- 18392800 records received --- 133314.602 msg/s --- 1041.520 Mbit/s
@315157973 315157973 deleted the perf2 branch November 28, 2020 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants