- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 aerospike 集合中,我们有四个 bin userId、adId、timestamp、eventype,主键是 userId:timestamp。在 userId 上创建二级索引以获取特定用户的所有记录,并将结果记录传递给流 udf。在我们的客户端,直到 500 qps,aerospike 查询延迟是合理的,平均延迟以微秒为单位,但是一旦我们将 qps 增加到 500 以上,aerospike 查询延迟就会激增(大约 10 毫秒)
我们在客户端看到的消息附在下面:
Name: Aerospike-13780
State: WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@41aa29a4
Total blocked: 0 Total waited: 554,450
Stack trace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
com.aerospike.client.lua.LuaInputStream.read(LuaInputStream.java:38)
com.aerospike.client.lua.LuaStreamLib$read.call(LuaStreamLib.java:60)
org.luaj.vm2.LuaClosure.execute(Unknown Source)
org.luaj.vm2.LuaClosure.onInvoke(Unknown Source)
org.luaj.vm2.LuaClosure.invoke(Unknown Source)
org.luaj.vm2.LuaClosure.execute(Unknown Source)
org.luaj.vm2.LuaClosure.onInvoke(Unknown Source)
org.luaj.vm2.LuaClosure.invoke(Unknown Source)
org.luaj.vm2.LuaValue.invoke(Unknown Source)
com.aerospike.client.lua.LuaInstance.call(LuaInstance.java:128)
com.aerospike.client.query.QueryAggregateExecutor.runThreads(QueryAggregateExecutor.java:104)
com.aerospike.client.query.QueryAggregateExecutor.run(QueryAggregateExecutor.java:77)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
下面是lua文件:
function ad_count(stream)
local function map_function(record)
local result = map()
result["adId"] = record["adId"]
result["timestamp"] = record["timestamp"]
return result
end
local function add_fn(aggregate, record)
local ad_id = record["adId"]
local map_result = aggregate[ad_id]
local l = list()
if map_result == null then
map_result = l
end
list.append(map_result, record["timestamp"])
aggregate[ad_id] = map_result
return aggregate
end
local m = map()
return stream:map(map_function):aggregate(m, add_fn)
end
有 2 个节点,服务器托管在 AWS 中,实例类型为 T2.large。
transaction-queues=8;transaction-threads-per-queue=8;transaction-duplicate-threads=0;transaction-pending-limit=20;migrate-threads=1;migrate-xmit-priority=40;migrate-xmit-sleep=500;migrate-read-priority=10;migrate-read-sleep=500;migrate-xmit-hwm=10;migrate-xmit-lwm=5;migrate-max-num-incoming=256;migrate-rx-lifetime-ms=60000;proto-fd-max=15000;proto-fd-idle-ms=60000;proto-slow-netio-sleep-ms=1;transaction-retry-ms=1000;transaction-max-ms=1000;transaction-repeatable-read=false;dump-message-above-size=134217728;ticker-interval=10;microbenchmarks=false;storage-benchmarks=false;ldt-benchmarks=false;scan-max-active=100;scan-max-done=100;scan-max-udf-transactions=32;scan-threads=4;batch-index-threads=4;batch-threads=4;batch-max-requests=5000;batch-max-buffers-per-queue=255;batch-max-unused-buffers=256;batch-priority=200;nsup-delete-sleep=100;nsup-period=120;nsup-startup-evict=true;paxos-retransmit-period=5;paxos-single-replica-limit=1;paxos-max-cluster-size=32;paxos-protocol=v3;paxos-recovery-policy=manual;write-duplicate-resolution-disable=false;respond-client-on-master-completion=false;replication-fire-and-forget=false;info-threads=16;allow-inline-transactions=true;use-queue-per-device=false;snub-nodes=false;fb-health-msg-per-burst=0;fb-health-msg-timeout=200;fb-health-good-pct=50;fb-health-bad-pct=0;auto-dun=false;auto-undun=false;prole-extra-ttl=0;max-msgs-per-type=-1;service-threads=40;fabric-workers=16;pidfile=/var/run/aerospike/asd.pid;memory-accounting=false;udf-runtime-gmax-memory=18446744073709551615;udf-runtime-max-memory=18446744073709551615;sindex-builder-threads=4;sindex-data-max-memory=18446744073709551615;query-threads=6;query-worker-threads=15;query-priority=10;query-in-transaction-thread=0;query-req-in-query-thread=0;query-req-max-inflight=100;query-bufpool-size=256;query-batch-size=100;query-priority-sleep-us=1;query-short-q-max-size=500;query-long-q-max-size=500;query-rec-count-bound=18446744073709551615;query-threshold=10;query-untracked-time-ms=1000;pre-reserve-qnodes=false;service-address=0.0.0.0;service-port=3000;mesh-address=10.0.1.80;mesh-port=3002;reuse-address=true;fabric-port=3001;fabric-keepalive-enabled=true;fabric-keepalive-time=1;fabric-keepalive-intvl=1;fabric-keepalive-probes=10;network-info-port=3003;enable-fastpath=true;heartbeat-mode=mesh;heartbeat-protocol=v2;heartbeat-address=10.0.1.80;heartbeat-port=3002;heartbeat-interval=150;heartbeat-timeout=10;enable-security=false;privilege-refresh-period=300;report-authentication-sinks=0;report-data-op-sinks=0;report-sys-admin-sinks=0;report-user-admin-sinks=0;report-violation-sinks=0;syslog-local=-1;enable-xdr=false;xdr-namedpipe-path=NULL;forward-xdr-writes=false;xdr-delete-shipping-enabled=true;xdr-nsup-deletes-enabled=false;stop-writes-noxdr=false;reads-hist-track-back=1800;reads-hist-track-slice=10;reads-hist-track-thresholds=1,8,64;writes_master-hist-track-back=1800;writes_master-hist-track-slice=10;writes_master-hist-track-thresholds=1,8,64;proxy-hist-track-back=1800;proxy-hist-track-slice=10;proxy-hist-track-thresholds=1,8,64;udf-hist-track-back=1800;udf-hist-track-slice=10;udf-hist-track-thresholds=1,8,64;query-hist-track-back=1800;query-hist-track-slice=10;query-hist-track-thresholds=1,8,64;query_rec_count-hist-track-back=1800;query_rec_count-hist-track-slice=10;query_rec_count-hist-track-thresholds=1,8,64
我们甚至更改了以下配置参数,但它进一步增加了延迟:
query-batch-size=1000
query-short-q-max-size=100000
query-long-q-max-size=100000
query-threads=28
query-worker-threads=400
query-req-max-inflight=1000
最佳答案
链接回 Aerospike 社区论坛上的同一问题:https://discuss.aerospike.com/t/high-query-latency/2769/3
您主要是在挑战特定实例的限制。我们不建议使用 t2 系列。请查看recommendations Aerospike 的亚马逊部署指南部分。您应该考虑 m3、c3、c4、r3 或 i2 实例系列中的实例。
关于您的配置的快速说明:
transaction-queues
应根据核心数进行调整。您将其设置为 8,并且 t2.large 有 2 个核心。transaction-threads-per-queue
对于此实例类型设置得太高。query-threads
和 query-worker-threads
对于这个实例都设置得太高了。此外,您的查询涉及流 UDF,因此它们将比常规查询慢。 UDF 很有用,但您需要考虑它们适合的上下文。
我的建议是您可以采用不同的方式对此进行建模,并跳过二级索引和 UDF。
关于lua - 高 Aerospike 延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36400687/
如果两个连接试图创建同一条记录,aerospike 如何确保只有其中一个能够成功执行?Aerospike 为单个记录上的操作维护一个队列。因此,如果一条记录存在,则对该记录的所有操作都可以串行执行。但
我想知道如何在 Aerospike 中表示关系?我意识到这是一个键值存储,但有没有可以给出的例子? 例如:如果系统中有用户,我想获取与该用户关联的事物记录列表。 最佳答案 几个快速的想法: 1- 让每
我想在 aerospike 中导入以下 csv 文件数据,并希望触发简单的选择查询以使用 python 作为客户端显示数据 例如 policyID,statecode,county,eq_site_l
我目前有一个包含两个节点的工作集群。以下是 /etc/aerospike/aerospike.conf 的内容 - network { service { address an
我们有一个由 8 个节点组成的 aerospike 集群。我们看到,在高峰时段,与其他节点相比,其中一个节点的平均负载明显更高。同样在 AMC 仪表板中,我们看到该节点只有 30% 的读取成功率。在关
有什么办法可以从 aql 或 CLI 的命名空间(Aerospike)中删除一个集合??? 我的集合还包含 Ldts 。 请给我建议一种从 LDT 中删除整个 Set 的方法 最佳答案 您可以使用删除
Aerospike 是一个支持持久性的 key 存储数据库。 但是我可以完全信任这种持久性以将其用作数据库吗? 据我了解,它首先将数据写入内存,然后将其持久化。 我可以忍受最终的一致性,但我不想处于提
我正在考虑将 aerospike 用于我们的一个项目。所以我目前创建了一个 3 节点集群并在其上加载了一些数据。 示例数据 ns: 串号 设置:串号 +-------------------+----
我目前正在设计一个 Aerospike Cluster,它可以处理许多关系,并且会很快变得非常大。我在 aerospike 文档中发现了许多关于使用 python 客户端检索 key 时生成的摘要的引
我们配置了多个客户端来与这个 aerospike 节点集群进行通信。现在我们已经从我们知道的所有客户端中删除了配置,仍然有一些读/写请求传入该集群,如 AMC 中所示。 我查看了/var/log/ae
我正在尝试了解如何最好地构建我的 Aerospike 架构。当我尝试使用它时,我意识到部分问题是我没有完全理解 Aerospike 处理数据的方式,这似乎与 RDBMS 和 Cassandra 不同。
众所周知,Aerospike 服务器不支持某些数据类型,例如 Float。但它们是在客户端处理的。例如,1.0.40 版的 Python 客户端使用序列化支持不受支持的数据类型。 我想知道客户端在从服
我正在尝试了解如何最好地构建我的 Aerospike 架构。当我尝试使用它时,我意识到部分问题是我没有完全理解 Aerospike 处理数据的方式,这似乎与 RDBMS 和 Cassandra 不同。
众所周知,Aerospike 服务器不支持某些数据类型,例如 Float。但它们是在客户端处理的。例如,1.0.40 版的 Python 客户端使用序列化支持不受支持的数据类型。 我想知道客户端在从服
我在一组中有数百万条记录。我想检索所有匹配相同模式的记录。 例如我可能有: id=4444?mode=mode1?fieldA=abc id=4444?mode=mode1?fieldA=azerty
我想从命名空间的集合中选择随机“n”个容器的样本。有没有办法在 Aerospike 查询语言中实现这一点? 在 Oracle 中,我们通过以下查询实现了类似的功能: SELECT * FROM sa
我正在使用 Aerospike 4.8v 并将我的数据保存在磁盘上,并且我正在向 aerospike 发出并行写入请求,如果我发出 10 个并行请求,那么它工作正常,但是当我发出 100 个并行请求时
我想在 aerospike 中查看数据,但找不到任何 GUI 工具。像aql这样的控制台应用程序令人不舒服。有这样的GUI工具吗? 最佳答案 当前答案:2021 打电话过来,想让我更改语音信箱。 ht
HBase 的协处理器是“移动计算而不是数据”的一个很好的例子。不确定 Aerospike 是否支持类似的功能? 最佳答案 Aerospike 支持用户定义函数 (UDF),这些函数是用户加载到数据库
我有一个包含两个 bin 的现有记录,我需要使用 java 客户端 API 向它添加第三个 bin val client = new AerospikeClient("localhost",3000)
我是一名优秀的程序员,十分优秀!