Skip to content

Instantly share code, notes, and snippets.

/ES Command Line Secret

Created April 3, 2013 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5010665a1d1f6c5a8b7c to your computer and use it in GitHub Desktop.
Save anonymous/5010665a1d1f6c5a8b7c to your computer and use it in GitHub Desktop.
Problematic search config
cluster.name: search-prd
#################################### Node #####################################
node.name: XXXX
node.max_local_storage_nodes: 1
#################################### Index ####################################
index.mapper.dynamic: true
action.auto_create_index: true
action.disable_delete_all_indices: true
#################################### Paths ####################################
path.conf: /usr/local/etc/elasticsearch
path.data: /data/elasticsearch
path.logs: /var/log/elasticsearch
#################################### Plugin ###################################
################################### Memory ####################################
bootstrap.mlockall: true
############################## Network And HTTP ###############################
################################### Gateway ###################################
gateway.type: local
gateway.expected_nodes: 2
############################# Recovery Throttling #############################
################################## Discovery ##################################
discovery.zen.minimum_master_nodes: 1
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.enabled: true
discovery.zen.ping.unicast.hosts:
- YYYY
cloud.node.auto_attributes: true
################################## Slow Log ###################################
index.search.slowlog.threshold.query.warn: 10s
index.search.slowlog.threshold.query.info: 5s
index.search.slowlog.threshold.query.debug: 2s
index.search.slowlog.threshold.query.trace: 500ms
################################## GC Logging #################################
monitor.jvm.gc.ParNew.warn: 1000ms
monitor.jvm.gc.ParNew.info: 700ms
monitor.jvm.gc.ParNew.debug: 400ms
monitor.jvm.gc.ConcurrentMarkSweep.warn: 10s
monitor.jvm.gc.ConcurrentMarkSweep.info: 5s
monitor.jvm.gc.ConcurrentMarkSweep.debug: 2s
java \
-server \
-Djava.net.preferIPv4Stack=true \
-Xms4470m -Xmx4470m -Xss256k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError \
-Delasticsearch \
-Des.path.home=/usr/local/elasticsearch \
-cp :/usr/local/elasticsearch/lib/*:/usr/local/elasticsearch/lib/sigar/* org.elasticsearch.bootstrap.ElasticSearch
::: [YYYY][k3WKOHjvQNqYKvbWiToadg][inet[YYYY:9300]]{max_local_storage_nodes=1}
42.8% (214.2ms out of 500ms) cpu usage by thread 'elasticsearch[YYYY][cache][T#4]'
3/10 snapshots sharing following 4 elements
org.elasticsearch.index.cache.bloom.simple.SimpleBloomCache$BloomFilterLoader.run(SimpleBloomCache.java:200)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
7/10 snapshots sharing following 3 elements
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
26.0% (130ms out of 500ms) cpu usage by thread 'elasticsearch[YYYY][cache][T#2]'
3/10 snapshots sharing following 3 elements
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
7/10 snapshots sharing following 9 elements
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.awaitMatch(LinkedTransferQueue.java:702)
org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.xfer(LinkedTransferQueue.java:615)
org.elasticsearch.common.util.concurrent.jsr166y.LinkedTransferQueue.poll(LinkedTransferQueue.java:1117)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
25.9% (129.6ms out of 500ms) cpu usage by thread 'elasticsearch[YYYY][cache][T#1]'
2/10 snapshots sharing following 4 elements
org.elasticsearch.index.cache.bloom.simple.SimpleBloomCache$BloomFilterLoader.run(SimpleBloomCache.java:200)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
3/10 snapshots sharing following 10 elements
org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:162)
org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:270)
org.apache.lucene.store.BufferedIndexInput.readBytes(BufferedIndexInput.java:136)
org.apache.lucene.store.BufferedIndexInput.readBytes(BufferedIndexInput.java:111)
org.apache.lucene.index.TermBuffer.read(TermBuffer.java:82)
org.apache.lucene.index.SegmentTermEnum.next(SegmentTermEnum.java:133)
org.elasticsearch.index.cache.bloom.simple.SimpleBloomCache$BloomFilterLoader.run(SimpleBloomCache.java:203)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
2/10 snapshots sharing following 14 elements
sun.nio.ch.NativeThread.current(Native Method)
sun.nio.ch.NativeThreadSet.add(NativeThreadSet.java:46)
sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:670)
org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:162)
org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:270)
org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:40)
org.apache.lucene.store.DataInput.readVInt(DataInput.java:107)
org.apache.lucene.store.BufferedIndexInput.readVInt(BufferedIndexInput.java:217)
org.apache.lucene.index.TermBuffer.read(TermBuffer.java:86)
org.apache.lucene.index.SegmentTermEnum.next(SegmentTermEnum.java:133)
org.elasticsearch.index.cache.bloom.simple.SimpleBloomCache$BloomFilterLoader.run(SimpleBloomCache.java:203)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
3/10 snapshots sharing following 3 elements
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
::: [XXXX][nh7sJS21Sna5ZNSIbR9W8A][inet[/YYYY]]{max_local_storage_nodes=1}
21.2% (105.7ms out of 500ms) cpu usage by thread 'elasticsearch[XXXX][search][T#251]'
3/10 snapshots sharing following 35 elements
org.apache.lucene.search.Searcher.createNormalizedWeight(Searcher.java:168)
org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:664)
org.elasticsearch.search.internal.ContextIndexSearcher.createNormalizedWeight(ContextIndexSearcher.java:133)
org.apache.lucene.search.Query.weight(Query.java:103)
org.elasticsearch.common.lucene.search.function.FunctionScoreQuery$CustomBoostFactorWeight.<init>(FunctionScoreQuery.java:76)
org.elasticsearch.common.lucene.search.function.FunctionScoreQuery.createWeight(FunctionScoreQuery.java:67)
org.apache.lucene.search.DisjunctionMaxQuery$DisjunctionMaxWeight.<init>(DisjunctionMaxQuery.java:107)
org.apache.lucene.search.DisjunctionMaxQuery.createWeight(DisjunctionMaxQuery.java:184)
org.apache.lucene.search.FilteredQuery.createWeight(FilteredQuery.java:63)
org.apache.lucene.search.Searcher.createNormalizedWeight(Searcher.java:168)
org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:664)
org.elasticsearch.search.internal.ContextIndexSearcher.createNormalizedWeight(ContextIndexSearcher.java:133)
org.apache.lucene.search.Query.weight(Query.java:103)
org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery$CustomBoostFactorWeight.<init>(FiltersFunctionScoreQuery.java:119)
org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery.createWeight(FiltersFunctionScoreQuery.java:110)
org.apache.lucene.search.Searcher.createNormalizedWeight(Searcher.java:168)
org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:664)
org.elasticsearch.search.internal.ContextIndexSearcher.createNormalizedWeight(ContextIndexSearcher.java:133)
org.apache.lucene.search.Query.weight(Query.java:103)
org.elasticsearch.common.lucene.search.function.FunctionScoreQuery$CustomBoostFactorWeight.<init>(FunctionScoreQuery.java:76)
org.elasticsearch.common.lucene.search.function.FunctionScoreQuery.createWeight(FunctionScoreQuery.java:67)
org.apache.lucene.search.FilteredQuery.createWeight(FilteredQuery.java:63)
org.apache.lucene.search.Searcher.createNormalizedWeight(Searcher.java:168)
org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:664)
org.elasticsearch.search.internal.ContextIndexSearcher.createNormalizedWeight(ContextIndexSearcher.java:133)
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:178)
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:242)
org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:529)
org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:518)
org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:268)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
7/10 snapshots sharing following 2 elements
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
19.9% (99.4ms out of 500ms) cpu usage by thread 'elasticsearch[XXXX][search][T#246]'
7/10 snapshots sharing following 9 elements
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
2/10 snapshots sharing following 10 elements
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:178)
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:242)
org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:529)
org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:518)
org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.run(MessageChannelHandler.java:268)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
unique snapshot
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
19.6% (97.9ms out of 500ms) cpu usage by thread 'elasticsearch[XXXX][search][T#272]'
10/10 snapshots sharing following 9 elements
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
'mappings': {
'user': {
'properties': {
'_id': { 'type': 'long', 'index': 'not_analyzed' },
'username': { 'type': 'string' },
'username.parsed': { 'type': 'string', 'analyzer': 'filtered_username' },
'description': { 'type': 'string', 'boost': 0.1 },
'followerCount': { 'type': 'long' },
'suspended': { 'type': 'boolean' },
'verified': { 'type': 'boolean' },
'explicitContent': { 'type': 'boolean' },
'created': { 'type': 'date' },
'deleted': { 'type': 'boolean' },
}
},
'follow': {
'_parent': { 'type': 'user' },
'properties': {
'userId': { 'type': 'long' },
'followerId': { 'type': 'long' },
}
}
},
'settings': {
'index': {
'number_of_shards': 5,
'number_of_replicas': 1,
'refresh_interval': '15s',
'store': {
'compress': {
'stored': True
}
}
},
'analysis': {
'analyzer': {
'default': {
'type': 'custom',
'tokenizer': 'standard',
'filter': ['standard', 'lowercase', 'stop']
},
'unfiltered_username': {
'type': 'custom',
'tokenizer': 'standard',
'filter': ['standard', 'username_word_delimiter',
'lowercase', 'autocomplete']
},
'filtered_username': {
'type': 'custom',
'tokenizer': 'standard',
'filter': ['standard', 'username_word_delimiter',
'lowercase', 'stop', 'autocomplete']
}
},
'filter': {
'autocomplete': {
'type': 'edgeNGram',
'min_gram': 1,
'max_gram': 20,
'side': 'front'
},
'username_word_delimiter': {
'type': 'word_delimiter',
'preserve_original': True,
},
'stop': {
'type': 'stop',
'stopwords_path': 'stopwords.txt',
},
}
}
}
{
'fields': [],
'from': 0,
'query': {
'custom_score': {
'query': {
'custom_filters_score': {
'filters': [
{'boost': '10.0', 'filter': {'term': {'verified': True}}},
{'boost': '0.00001', 'filter': {'term': {'explicitContent': True}}}],
'query': {
'filtered': {
'filter': {
'and': [{'term': {'deleted': False}}, {'term': {'suspended': False}}]
},
'query': {
'dis_max': {
'queries': [
{'custom_boost_factor': {'boost_factor': 1.0,
'query': {'match_phrase': {'username': {'operator': 'and', 'query': 'hello world'}}}}},
{'custom_boost_factor': {'boost_factor': 0.8,
'query': {'match_phrase': {'username.parsed': {'operator': 'and', 'query': 'hello world'}}}}},
{'custom_boost_factor': {'boost_factor': 0.01,
'query': {'match_phrase': {'description': {'operator': 'and', 'query': 'hello world'}}}}}]}}}},
'score_mode': 'multiply'}},
'script': "_score * (1.0 + doc['followerCount'].value / 100.0)"}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment