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

[feat]curvefs/client kvcache monitor #2806

Merged

Conversation

Cyber-SiKu
Copy link
Contributor

  1. fix base metric(bps/qps/latnecy) error
  2. add hit and miss metric
  3. change metric prefix to curvefs_kvclient_manager
  4. add memcache client metric

What problem does this PR solve?

Issue Number: #xxx

Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

image
image

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@Cyber-SiKu Cyber-SiKu force-pushed the feat/curvefs/client/kvcache_monitor branch 2 times, most recently from bac2a5f to 64f0099 Compare October 16, 2023 08:41
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu Cyber-SiKu force-pushed the feat/curvefs/client/kvcache_monitor branch from 64f0099 to d452499 Compare October 16, 2023 09:06
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0https://godbolt.org/
Copy link
Contributor

Choose a reason for hiding this comment

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

typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo?

fix

Comment on lines +83 to +84
case MEMCACHED_DATA_DOES_NOT_EXIST:
// The data requested with the key given was not found.
case MEMCACHED_DATA_EXISTS:
Copy link
Contributor

Choose a reason for hiding this comment

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

same meaning of exists and not exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

it's interesting ⁉️

client_ = kvclient;
kvClientManagerMetric_ = std::make_shared<KVClientManagerMetric>(fsName);
Copy link
Contributor

Choose a reason for hiding this comment

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

unique_ptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


task->done(task);
if (task->res) {
kvClientManagerMetric_->count << 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that there are hits and misses, is count redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that there are hits and misses, is count redundant?

count means set

hits and miss are get

void KVClientManager::Get(std::shared_ptr<GetKVCacheTask> task) {
threadPool_.Enqueue([task, this]() {
LatencyGuard guard(&kvClientMetric_.kvClientGet.latency);
LatencyGuard guard(&kvClientManagerMetric_->get.latency);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we only update metric for susuccessful request?

@@ -104,15 +114,17 @@ class KVClientManager {

void Get(std::shared_ptr<GetKVCacheTask> task);
Copy link
Contributor

Choose a reason for hiding this comment

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

why shared_ptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why shared_ptr?

i don't known

Comment on lines +319 to +335
InterfaceMetric get;
InterfaceMetric set;
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the difference between KVClientManagerMetric's get/set ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what's the difference between KVClientManagerMetric's get/set ?

manager will put set task to queue.

this write to memcache

@Cyber-SiKu Cyber-SiKu force-pushed the feat/curvefs/client/kvcache_monitor branch 3 times, most recently from 81d0be4 to cb1a6a5 Compare October 16, 2023 10:27
@@ -71,7 +72,8 @@ struct GetKVCacheTask {
const std::string& key;
char* value;
uint64_t offset;
uint64_t length;
uint64_t valueLength;
uint64_t length; // actual length of value
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what's the difference?

One is the length of value, and the other is the length of the object obtained from kvcache.

@SeanHai
Copy link
Contributor

SeanHai commented Oct 16, 2023

What's the difference of latency of kvclientmanager and memcachedClient ?

@SeanHai
Copy link
Contributor

SeanHai commented Oct 16, 2023

Are the units of set latency in the kvcache manager panel correct?

@Cyber-SiKu
Copy link
Contributor Author

Cyber-SiKu commented Oct 16, 2023

What's the difference of latency of kvclientmanager and memcachedClient ?

kvCachemanager is used to manage memcacheclient. Because kvcache uses a thread pool for asynchronous IO, and memcacheclient uses synchronous IO. So separating the two shows how long io waits in the queue.

@Cyber-SiKu
Copy link
Contributor Author

Are the units of set latency in the kvcache manager panel correct?

fix by pr#2808

@Cyber-SiKu Cyber-SiKu force-pushed the feat/curvefs/client/kvcache_monitor branch from cb1a6a5 to 8cc7ab1 Compare October 16, 2023 12:35
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu Cyber-SiKu closed this Oct 17, 2023
@Cyber-SiKu Cyber-SiKu reopened this Oct 17, 2023
@Cyber-SiKu Cyber-SiKu force-pushed the feat/curvefs/client/kvcache_monitor branch from 8cc7ab1 to 4cc32e4 Compare October 17, 2023 12:12
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu Cyber-SiKu closed this Oct 18, 2023
@Cyber-SiKu Cyber-SiKu reopened this Oct 18, 2023
@Cyber-SiKu
Copy link
Contributor Author

cicheck

1 similar comment
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu Cyber-SiKu force-pushed the feat/curvefs/client/kvcache_monitor branch from 4cc32e4 to 4b31b8e Compare October 19, 2023 02:18
@Cyber-SiKu Cyber-SiKu closed this Oct 19, 2023
@Cyber-SiKu Cyber-SiKu reopened this Oct 19, 2023
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

6 similar comments
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

8 similar comments
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

1. fix base metric(bps/qps/latnecy) error
2. add hit and miss metric
3. change metric prefix to curvefs_kvclient_manager
4. add memcache client metric

Signed-off-by: Cyber-SiKu <Cyber-SiKu@outlook.com>
@Cyber-SiKu Cyber-SiKu force-pushed the feat/curvefs/client/kvcache_monitor branch from 4b31b8e to 5e44c53 Compare October 21, 2023 13:03
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu Cyber-SiKu closed this Oct 21, 2023
@Cyber-SiKu Cyber-SiKu reopened this Oct 21, 2023
@Cyber-SiKu
Copy link
Contributor Author

cicheck

4 similar comments
@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu
Copy link
Contributor Author

cicheck

@Cyber-SiKu Cyber-SiKu merged commit cc5095a into opencurve:master Oct 23, 2023
7 checks passed
@Cyber-SiKu Cyber-SiKu deleted the feat/curvefs/client/kvcache_monitor branch October 23, 2023 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants