微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AerospikeError 此时不允许操作,而只做读取

如何解决AerospikeError 此时不允许操作,而只做读取

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

我正在根据我创建的多个索引查询数据。代码如下所示:

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.integerBin('date1'),predexp.integerValue(predicates.date2),predexp.integerGreaterEq(),predexp.integerBin('date2'),predexp.integerLessEq(),predexp.stringValue(predicates.column3),predexp.stringBin('column3'),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;
}

这失败了,我收到以下错误

 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 内容

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 个请求应该有效,因为我能够每秒插入大约 12K 条记录。

解决方法

我猜这些是扫描,而不是单个读取。要增加 scan-threads-limit

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。