首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >仅执行读取操作时,此时不允许AerospikeError操作

仅执行读取操作时,此时不允许AerospikeError操作
EN

Stack Overflow用户
提问于 2021-03-31 18:42:35
回答 1查看 94关注 0票数 0

我正在尝试用50个并行读请求对我的代码进行负载测试。

我正在根据我创建的多个索引查询数据。代码看起来像这样:

代码语言:javascript
复制
const fetchRecords = async (predicates) => {
  let query = aeroClient.query('test', 'mySet');

  let filters = [
      predexp.stringValue(predicates.load),
      predexp.stringBin('load'),
      predexp.stringEqual(),
      predexp.stringValue(predicates.disc),
      predexp.stringBin('disc'),
      predexp.stringEqual(),
      predexp.integerBin('date1'),
      predexp.integerValue(predicates.date2),
      predexp.integerGreaterEq(),
      predexp.integerBin('date2'),
      predexp.integerValue(predicates.date2),
      predexp.integerLessEq(),
      predexp.stringValue(predicates.column3),
      predexp.stringBin('column3'),
      predexp.stringEqual(),
      predexp.and(5),
  ]
  query.where(filters);

  let records = [];
  let stream = query.foreach();
  stream.on('data', record => {
      records.push(record); 
  })
  stream.on('error', error => { throw error });
  await new Promise((resolve, reject) => {
      stream.on('end', () => resolve());
  });
  return records;
}

此操作失败,并且我得到以下错误:

代码语言:javascript
复制
 AerospikeError: Operation not allowed at this time.
    at Function.fromASError (/Users/.../node_modules/aerospike/lib/error.js:113:21)
    at QueryCommand.convertError (/Users/.../node_modules/aerospike/lib/commands/command.js:91:27)
    at QueryCommand.convertResponse (/Users/.../node_modules/aerospike/lib/commands/command.js:101:24)
    at asCallback (/Users/.../node_modules/aerospike/lib/commands/command.js:163:24)

我的aerospike.conf内容:

代码语言:javascript
复制
service {
    user root
    group root
    paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
    pidfile /var/run/aerospike/asd.pid
#   service-threads 6 # cpu x 5 in 4.7 
#   transaction-queues 6 # obsolete in 4.7 
#   transaction-threads-per-queue 4 # obsolete in 4.7
    proto-fd-max 15000
}
<...trimmed section>
namespace test {
    replication-factor 2
    memory-size 1G
    default-ttl 30d # 5 days, use 0 to never expire/evict.
    nsup-period 120
    #   storage-engine memory

    # To use file storage backing, comment out the line above and use the
    # following lines instead.

    storage-engine device {
        file /opt/aerospike/data/test.dat
        filesize 4G
        data-in-memory true # Store data in memory in addition to file.
    }
}

从一个类似的问题中,我发现这是由于低系统配置造成的。我如何修改这些。此外,我相信50个请求应该是有效的,因为我能够插入大约12000条记录/秒。

EN

回答 1

Stack Overflow用户

发布于 2021-04-01 11:19:35

我猜这些是扫描,而不是单独读取。增加scan-threads-limit的步骤

asinfo -v "set-config:context=service;scan-threads-limit=128"

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66886229

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档