1 亿左右的数据,数据来源是设备的轨迹数据(gps ,速度,温度等信息),设备端按 5s 左右一次上报
我自己尝试搭建了 3 个节点的 es ,每个节点 4g 左右内存,发现执行需求 1 时,大概需要 2-5s 左右,查询语句:
curl -X GET "http://192.168.1.210:9200/test_index/_search?pretty" \
-H 'Content-Type: application/json' \
-d '{
"query": {
"terms": {
"serialNumber": [省略 sn]
}
},
"collapse": {
"field": "serialNumber"
},
"size": 300
}'
mapping 信息:
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1,
"index": {
"sort.field": "createTime",
"sort.order": "desc"
}
},
"mappings": {
"properties": {
"serialNumber": {
"type": "keyword"
},
"createTime": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss"
},
"longitude": {
"type": "double"
},
"latitude": {
"type": "double"
}
}
}
}
请问可以做到需求 1 查询 3-400 台设备,耗时到 1s 左右吗?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.