EC2 配置
mlarge machine -
4 CPU,
7.5G,
EBS volume,
JVM Memory - 6G,
Solr Version tested on both 4.0-ALPHA and 3.6.1
架构.xml
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="4" positionIncrementGap="0"/>
<field name="id" type="long" indexed="true" stored="true" required="true" />
<field name="location" type="location" indexed="true" stored="true"/>
<field name="location_0_coordinate" type="tdouble" indexed="true" stored="true" />
<field name="location_1_coordinate" type="tdouble" indexed="true" stored="true" />
<field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
solrconfig.xml 没有变化。
编辑:
<query>
<filterCache class="solr.FastLRUCache" size="512" initialSize="512" autowarmCount="0"/>
<queryResultCache class="solr.LRUCache" size="512" initialSize="512" autowarmCount="0"/>
<documentCache class="solr.LRUCache" size="512" initialSize="512" autowarmCount="0"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<queryResultWindowSize>20</queryResultWindowSize>
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
<useColdSearcher>false</useColdSearcher>
<maxWarmingSearchers>2</maxWarmingSearchers>
</query>
128M 的数据记录在其中加载。
Java 客户端代码
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("wt","csv");
params.set("df","id");
params.set("fl", "id,location");
params.set("q", "*:*");
params.set("fq", "{!geofilt}");
params.set("sfield", "location");
params.set("d", "0.05");
params.set("pt", columns[1] +"," + columns[2]);
QueryResponse response = solr.query(params);
最佳
Tasks: 71 total, 1 running, 70 sleeping, 0 stopped, 0 zombie
Cpu(s): 38.7%us, 0.0%sy, 0.0%ni, 49.4%id, 0.0%wa, 0.0%hi, 0.0%si, 11.9%st
Mem: 7634740k total, 7570960k used, 63780k free, 150708k buffers
Swap: 0k total, 0k used, 0k free, 3914812k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
956 root 20 0 25.7g 4.0g 889m S 100.1 55.2 353:48.70 java
结果是,查询一个文档平均需要大约 1.5 秒。
record 203 response Time 1108 result: 42.7461000,-73.6924000,
record 207 response Time 1123 result: 40.8448850,-73.7156030,
record 210 response Time 1180 result: 40.8087660,-74.1583510,
record 211 response Time 1656 result: 0,
record 212 response Time 1423 result: 0,
record 213 response Time 1316 result: 39.1027710,-76.7964910.
有什么建议么?