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

Remove localClient.mtx #5411

Closed
4 tasks
jinsankim opened this issue Sep 28, 2020 · 6 comments
Closed
4 tasks

Remove localClient.mtx #5411

jinsankim opened this issue Sep 28, 2020 · 6 comments
Labels
T:jank Type Jank! Non-urgent but still high-impact fixes.

Comments

@jinsankim
Copy link

Summary

I found that my node's overall performance is slow down when I query something concurrently.

Problem Definition

I've set up my nodes and lcd, light client daemon. I found that my node's overall performance is slow down when I query something concurrently. W/ some investigating, I suspect now the bottle neck of this issue is (ABCI) localClient. I found that all functions of localClient is locked by localClient.mtx and also almost RPC handlers call localClient's functions.

Proposal

Could we remove localClient.mtx or revise it?


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@melekes
Copy link
Contributor

melekes commented Sep 28, 2020

It's something we discussed a while back. There are certain optimizations we can do. For example, we probably don't need to hold the mutex when calling app.callback. You're more than welcome to investigate further and send us a PR 😉

@jinsankim
Copy link
Author

jinsankim commented Sep 28, 2020

@melekes The issue, you mentioned, might be #2721 and the PR might be #2748, isn't it?

For example, we probably don't need to hold the mutex when calling app.callback

In my point of view, it looks like kind of micro optimization. I'm thinking more destructive way. I'm wondering why client , even though it's localClient, should protect server in terms of concurrency. With client side protection, I think we couldn't control and protect the critical section more efficient way. My idea is to remove the mutex from the client side and ABCI (or ABCI server) should protect itself from concurrency. Please could I get your feedback?

@melekes
Copy link
Contributor

melekes commented Sep 28, 2020

yeah, specifically this comment: #2748 (comment)

I'm wondering why client , even though it's localClient, should protect server in terms of concurrency

because there's no server?) localClient acts as both client & server

@jinsankim
Copy link
Author

because there's no server?) localClient acts as both client & server

I understand what you mean but, in my point of view, I consider ABCI implementation as a server. So I expressed ABCI (or ABCI server). I still think it's needed to remove mutex from localClient for optimization and also app, cosmos-sdk, or whatever implements ABCI interface should protect itself from concurrency for better optimization.

@tessr tessr added this to Untriaged in Tendermint Core Project Board via automation Nov 13, 2020
@tessr tessr added the T:jank Type Jank! Non-urgent but still high-impact fixes. label Nov 13, 2020
@melekes
Copy link
Contributor

melekes commented Feb 23, 2021

ABCI interface should protect itself from concurrency for better optimization.

I'm going to open a discussion on Github. This will change the current paradigm where Tendermint serialises calls to ABCI app.

Let's continue discussion in #6048.

@melekes melekes closed this as completed Feb 23, 2021
Tendermint Core Project Board automation moved this from Untriaged 🥚 to Done 🎉 Feb 23, 2021
@melekes
Copy link
Contributor

melekes commented Feb 23, 2021

#6171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:jank Type Jank! Non-urgent but still high-impact fixes.
Projects
No open projects
Development

No branches or pull requests

3 participants