Skip to content

Instantly share code, notes, and snippets.

@nik9000
nik9000 / gist:8918627
Created February 10, 2014 16:09
TEST-org.elasticsearch.search.facet.termsstats.ShardSizeTermsStatsFacetTests.xml
<testsuite errors="15" failures="2" tests="15" skipped="0" name="org.elasticsearch.search.facet.termsstats.ShardSizeTermsStatsFacetTests" hostname="nohost.nodomain" time="381.23" timestamp="2014-02-10T10:50:52">
<properties class="java.util.ArrayList">
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
<property name="es.logger.level" value="INFO"/>
<property name="es.logger.prefix" value=""/>
<property name="es.node.local" value=""/>
<property name="es.node.mode" value=""/>
<property name="file.encoding" value="UTF-8"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="file.separator" value="/"/>
#!/bin/bash
curl -s -XDELETE "http://localhost:9200/test?pretty" | tee /tmp/check_script_speed.log
curl -s -XPOST "http://localhost:9200/test?pretty" | tee -a /tmp/check_script_speed.log
curl -s -XPUT http://localhost:9200/test/test/_mapping?pretty -d'{
"test" : {
"properties": {
"i" : {
"type": "integer"
}
java.lang.Throwable.fillInStackTrace(Native Method)
java.lang.Throwable.fillInStackTrace(Throwable.java:782)
java.lang.Throwable.<init>(Throwable.java:265)
java.lang.Exception.<init>(Exception.java:66)
java.lang.RuntimeException.<init>(RuntimeException.java:62)
java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:53)
sun.reflect.GeneratedMethodAccessor247.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.elasticsearch.common.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:43)
@nik9000
nik9000 / gist:9528170
Last active August 29, 2015 13:57
Benchmark suggest
#!/bin/bash
function benchmark() {
echo -n "$1"
echo '
{
"size": 0,
"suggest": {
"text": "'$2'",
"title": {
@nik9000
nik9000 / gist:9529707
Last active August 29, 2015 13:57
With and without caching
While loading without caching:
min mean[+/-sd] median max
Short Total: 7 20 9.6 17 62
Nobel Total: 26 63 19.4 60 118
Medium Total: 124 243 59.9 238 454
Long Total: 309 729 147.5 743 1171
1 Total: 202 412 117.7 404 909
2 Total: 48 113 33.0 105 217
3 Total: 508 883 194.0 866 1429
4 Total: 280 518 105.3 503 868
function reindex() {
wiki=$1
TZ=UTC export REINDEX_START=$(date +%Y-%m-%dT%H:%m:%SZ)
mwscript extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php --wiki $wiki --reindexAndRemoveOk --indexIdentifier now --reindexProcesses 10 | tee ~/cirrus_log/$wiki.reindex.log
mwscript extensions/CirrusSearch/maintenance/forceSearchIndex.php --wiki $wiki --from $REINDEX_START --deletes | tee -a ~/cirrus_log/$wiki.reindex.log
mwscript extensions/CirrusSearch/maintenance/forceSearchIndex.php --wiki $wiki --from $REINDEX_START | tee -a ~/cirrus_log/$wiki.reindex.log
}
CIRRUSSEARCH CRITICAL - 2 indexes report 1 errors
mw_cirrus_versions...
shard 0...
replica 1...
expected state to be in [STARTED, RELOCATING] but was UNASSIGNED
diff --git a/Elastica/lib/Elastica/Transport/Http.php b/Elastica/lib/Elastica/Transport/Http.php
index 300e308..126fc7f 100644
--- a/Elastica/lib/Elastica/Transport/Http.php
+++ b/Elastica/lib/Elastica/Transport/Http.php
@@ -72,6 +72,7 @@ class Http extends AbstractTransport
}
curl_setopt($conn, CURLOPT_URL, $baseUri);
+ wfDebugLog( 'CirrusSearch', "Uri: $baseUri" );
curl_setopt($conn, CURLOPT_TIMEOUT, $connection->getTimeout());
function count() {
curl -s localhost:9200/_cluster/state | jq -c '.nodes as $nodes | .routing_nodes.nodes | [(keys[] as $index | {
node: $nodes[$index].name,
length: .[$index] | length
})] | sort_by(.node)[]'
}
count
{"length":390,"node":"elastic1001"}
mwdeploy 18789 0.0 0.0 4404 576 ? Ss 14:50 0:00 /bin/sh -c /usr/local/bin/mwscript extensions/Wikidata/extensions/Wikibase/lib/maintenance/dispatchChanges.php --wiki wikidatawiki --max-time 900 --batch-size 200 --dispatch-interval 30 2>&1 >> /var/log/wikidata/dispatcher4.log
mwdeploy 18791 0.0 0.0 4404 608 ? Ss 14:50 0:00 /bin/sh -c /usr/local/bin/mwscript extensions/Wikidata/extensions/Wikibase/lib/maintenance/dispatchChanges.php --wiki wikidatawiki --max-time 900 --batch-size 200 --dispatch-interval 30 2>&1 >> /var/log/wikidata/dispatcher3.log
mwdeploy 18794 0.0 0.0 12308 1452 ? S 14:50 0:00 /bin/bash /usr/local/bin/mwscript extensions/Wikidata/extensions/Wikibase/lib/maintenance/dispatchChanges.php --wiki wikidatawiki --max-time 900 --batch-size 200 --dispatch-interval 30
mwdeploy 18796 0.0 0.0 12308 1424 ? S 14:50 0:00 /bin/bash /usr/local/bin/mwscript extensions/Wikidata/extensions/Wikibase/lib/maintenance/dispatchChanges.php --wiki wikida