集群启动之后是否需要预热

你好

我想问一下,

  1. nebula集群离线加载,启动之后是否需要加载预热,如何把数据加载到缓存中去。
  2. 我现在一台机器有4块硬盘,rocksdb_blockcache 150G, 总的block_cache是否是 150*4=600G。
  3. 还有什么提高读取速度的参数优化建议吗?
    4.一块硬盘上存在多个storagepath 也即是对应起多个rocksdb实例会不会加速读取。

谢谢

  1. rocksdb在启动会把部分index/filter加载,目前不需要预热
  2. 目前block_cache是进程级别,所有进程下面的rocksdb共享
  3. 具体是指啥?
  4. 不好说,得实际测,我理解不会有很大提升

3 compaction对读会有帮助

我们在 用 cpp cliet kv 查询的时候 发往不同机器的request会出现如下错误, 偶发:

E1112 18:34:58.516834 54496 StorageClient.inl:123] Request to [10.9*.16*.9*:44500] failed: N6apache6thrift9transport19TTransportExceptionE: AsyncSocketException: socket closing after error (peer=10.97.162.91:44500, local=), type = Internal error

这是我们调用storage client 代码,并发起来会出错,我们的用法有什么问题吗?

auto hostAddrs = nebula::network::NetworkUtils::toHosts(host_port);

    if (!hostAddrs.ok()) {
        std::cout << "addrese is not ok" << std::endl;
        return -1;
    }

    std::shared_ptr<folly::IOThreadPoolExecutor> ioThreadPool = std::make_shared<folly::IOThreadPoolExecutor>(ioMeta);
    nebula::meta::MetaClientOptions options;
    options.inStoraged_ = true;

    std::shared_ptr<nebula::meta::MetaClient> metaClient =
            std::make_shared<nebula::meta::MetaClient>(ioThreadPool, hostAddrs.value(), options);
    std::cout << "listSpaceIds wait1" << std::endl;
    metaClient->waitForMetadReady();
    std::cout << "listSpaceIds wait2" << std::endl;
    
    nebula::GraphSpaceID id = 0;
    auto ret = metaClient->getSpaceIdByNameFromCache("kv");
    if (ret.ok()) {
        id = ret.value();
        std::cout << "kv space name  " << id << std::endl;
    } else {
        std::cout << "Cant' find by space name kv";
        return -1;
    }

    std::shared_ptr<folly::IOThreadPoolExecutor> ioThreadPoolStorage = std::make_shared<folly::IOThreadPoolExecutor>(ioStorage);


    std::shared_ptr<nebula::storage::StorageClient> storageClient =
            std::make_shared<nebula::storage::StorageClient>(ioThreadPoolStorage, metaClient.get());

暂时没看出毛病,不过可以检查下StorageClient里面给storage发送rpc请求的地址是否正确,大概率是某个地方地址对不上。

多线程并发可以使用同一个StorageClient吗?还是每个线程要单独的客户端

我看Thrift 好像存在线程不安全,有没有多线程读取情况下的推荐StorageClient用法

现在客户端都是非线程安全的。多线程的时候,你只要保证每个线程的client都是本线程自己new出来的,这样使用是不会有问题的。