Skip to content

[native] Transfer idle HTTPSession between IO threads in exchange source#22903

Closed
Yuhta wants to merge 1 commit intoprestodb:masterfrom
Yuhta:export-D57842433
Closed

[native] Transfer idle HTTPSession between IO threads in exchange source#22903
Yuhta wants to merge 1 commit intoprestodb:masterfrom
Yuhta:export-D57842433

Conversation

@Yuhta
Copy link
Contributor

@Yuhta Yuhta commented Jun 3, 2024

Summary:
Currently each endpoint (server) has only one SessionPool, which can only be attached to one EventBase. If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one SessionPool for each endpoint and event base pair. Allow transfer of idle session between different event bases by using ServerIdleSessionController. This way we eliminate the bottleneck in event base while still keep the HttpSessions reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time. The SSL handshake cost (EVP_DigestSignFinal) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433

@Yuhta Yuhta requested a review from a team as a code owner June 3, 2024 17:32
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

@Yuhta Yuhta changed the title [presto_cpp] Transfer idle HTTPSession between IO threads in exchange source [native] Transfer idle HTTPSession between IO threads in exchange source Jun 3, 2024
Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 3, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from 1672021 to 1ad1593 Compare June 3, 2024 17:53
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 3, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from 1ad1593 to 6f87434 Compare June 3, 2024 17:55
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

aditi-pandit
aditi-pandit previously approved these changes Jun 3, 2024
Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Yuhta. This looks good. We will do a benchmark run to assess how this works in our systems.

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yuhta LGTM % minors. Thanks!

Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 4, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from 6f87434 to 73126a7 Compare June 4, 2024 17:14
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 4, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from 73126a7 to 00e8889 Compare June 4, 2024 17:16
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 4, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from 00e8889 to d438367 Compare June 4, 2024 17:20
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 4, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from d438367 to f2bd4ab Compare June 4, 2024 17:22
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

xiaoxmeng
xiaoxmeng previously approved these changes Jun 4, 2024
Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yuhta thanks for update. Looks great!

Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 4, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from f2bd4ab to b0f52c4 Compare June 4, 2024 20:32
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
@Yuhta Yuhta force-pushed the export-D57842433 branch from b0f52c4 to 3be4fdf Compare June 4, 2024 20:34
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D57842433

@Yuhta Yuhta closed this Jun 4, 2024
@Yuhta
Copy link
Contributor Author

Yuhta commented Jun 4, 2024

Yuhta added a commit to Yuhta/presto that referenced this pull request Jun 5, 2024
… source (prestodb#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
xiaoxmeng pushed a commit that referenced this pull request Jun 5, 2024
… source (#22903)

Summary:

Currently each endpoint (server) has only one `SessionPool`, which can only be attached to one `EventBase`.  If there is some skewness among the distribution (i.e. too many endpoints being attached to one event base), that event base would become bottleneck and cause regression in query wall time.

Fix this by creating one `SessionPool` for each endpoint and event base pair.  Allow transfer of idle session between different event bases by using `ServerIdleSessionController`.  This way we eliminate the bottleneck in event base while still keep the `HttpSession`s reusable.

After the fix, enabling connection pool should no longer cause any regression to wall time.  The SSL handshake cost (`EVP_DigestSignFinal`) is not visible in shuffle heavy queries when connection pool is enabled.

Reviewed By: xiaoxmeng, arhimondr

Differential Revision: D57842433
czentgr added a commit to czentgr/presto that referenced this pull request Jun 13, 2024
czentgr added a commit to czentgr/presto that referenced this pull request Jun 17, 2024
@wanglinsong wanglinsong mentioned this pull request Jun 25, 2024
36 tasks
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.

4 participants