-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwrite_optimization
177 lines (153 loc) · 3.48 KB
/
write_optimization
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
PUT /_cluster/settings
{
"transient": {
"logger.index.translog.fs": "TRACE"
}
}
PUT /_cluster/settings
{
"transient": {
"logger.index.merge.scheduler": "TRACE"
}
}
PUT /_settings
{
"index": {
"merge.scheduler.max_merge_count": 4,
"merge.scheduler.max_thread_count": 1,
"refresh_interval" : "30s"
}
}
PUT /_cluster/settings
{
"transient": {
"indices.store.throttle.type": "none"
}
}
curl -XPUT '127.0.0.1:9200/kafka*/_settings' -d '
{
"index" : {
"gateway.local.sync": "120s"
}
}'
curl -XPUT '127.0.0.1:9200/_settings' -d '
{
"index" : {
"translog.flush_threshold_size": "512m"
} }
'
curl -XPUT '127.0.0.1:9200/_settings' -d '
{
"index" : {
"translog.flush_threshold_period": "3600s"
} }
'
curl -XPUT '127.0.0.1:9200/_settings' -d '
{
"index" : {
"merge.policy.max_merged_segment" : "1g"
}
}'
index.warmer
index.merge.scheduler
index.translog.fs
PUT /_template/template_2
{
"order": 1,
"template": "kafka*",
"settings": {
"index.number_of_replicas": "1",
"index.number_of_shards": "4",
"index.refresh_interval": "30s",
"index.gateway.local.sync": "120s",
"index.translog.flush_threshold_size": "512m",
"index.translog.flush_threshold_period": "3600s",
"index.merge.policy.max_merged_segment": "1g",
"index.merge.scheduler.max_merge_count": 4,
"index.merge.scheduler.max_thread_count": 1
},
"mappings": {
"_default_": {
"_source": {
"includes": [
"@message"
]
},
"_all": {
"enabled": false
}
}
}
}
PUT /_template/template_2
{
"order": 1,
"template": "kafka*",
"settings": {
"index.number_of_replicas": "0",
"index.number_of_shards": "4",
"index.refresh_interval": "30s",
"index.gateway.local.sync": "120s",
"index.translog.flush_threshold_size": "512m",
"index.translog.flush_threshold_period": "3600s",
"index.merge.policy.max_merged_segment": "1g",
"index.merge.scheduler.max_merge_count": 4,
"index.merge.scheduler.max_thread_count": 1
},
"mappings": {
"_default_": {
"_all": {
"enabled": false
}
},
"employee": {
"_all": {
"enabled": false
},
"properties": {
"@message": {
"type": "string"
},
"@timestamp": {
"index": "no",
"type": "date",
"format": "dateOptionalTime",
"doc_values": true
},
"method": {
"type": "string",
"index": "no",
"doc_values": true
},
"response": {
"type": "long",
"index": "no",
"doc_values": true
},
"size": {
"type": "long",
"index": "no",
"doc_values": true
},
"srcip": {
"type": "string",
"index": "not_analyzed"
},
"status": {
"type": "string",
"index": "no",
"doc_values": true
},
"status_code": {
"type": "string",
"index": "no",
"doc_values": true
}
}
}
}
}
1千万数据 用插件over 387372 ms 每秒25819条
不用插件 400万 over 145151 ms 每秒27000 1千万 441秒 每秒 22675.7条
1千万 不存source over 290713 ms 每秒 34399条
1千万 source只存@message 406861 ms 每秒24630秒 423196 ms 419681 ms 427770 ms