Elasticsearch is using way too much disk space per document - elasticsearch

I'am using a 1.7 Elastic Search and try to index documents in it.
With 23 000 documents my index size is 17Go... This seems a way too large for only 23K docs (as my doc, in json, are around 13ko).
My doc have a lot of compound doc in it (the 13Ko is for all, doc + compound).
I keep the _all in my doc (and I need it).
I use this nGram tokeniser (maybe 2 is too low?)
'min_gram' => 2,
'max_gram' => 20
How a 13Ko per document become a 775Ko per doc after being added to Elastic?
Here a sample of my shards, where I had indexed only 1K doc :
dyb-fr_fr 4 p STARTED 7188 263.1mb 10.20.40.29 Doyoubuzz
dyb-fr_fr 0 p STARTED 7675 258.6mb 10.20.40.29 Doyoubuzz
dyb-fr_fr 3 p STARTED 7268 258.5mb 10.20.40.29 Doyoubuzz
dyb-fr_fr 1 p STARTED 8560 300.1mb 10.20.40.29 Doyoubuzz
dyb-fr_fr 2 p STARTED 7287 244.3mb 10.20.40.29 Doyoubuzz
And by going deeper on segments :
index shard prirep ip segment generation docs.count docs.deleted size size.memory committed searchable version compound
dyb-fr_fr 0 p 127.0.0.1 _2 2 291 0 9.7mb 173746 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _7 7 57 0 2.4mb 52650 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _d 13 43 0 2.8mb 71242 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _e 14 322 0 11.2mb 197706 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _f 15 1912 0 64.8mb 928522 false true 4.10.4 false
dyb-fr_fr 0 p 127.0.0.1 _k 20 64 0 1.4mb 43090 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _p 25 12 0 170.5kb 17794 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _t 29 1612 0 48.5mb 692322 false true 4.10.4 false
dyb-fr_fr 0 p 127.0.0.1 _y 34 228 0 6.9mb 128042 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _z 35 159 0 6.3mb 121266 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _13 39 232 0 6.4mb 125386 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _15 41 127 0 4.2mb 97738 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _16 42 1675 0 44.3mb 637266 false true 4.10.4 false
dyb-fr_fr 0 p 127.0.0.1 _17 43 203 0 4.3mb 92282 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _18 44 146 0 5.4mb 108730 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _19 45 236 0 6.3mb 115474 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _1a 46 63 0 2.1mb 52762 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _1b 47 118 0 4.2mb 88050 false true 4.10.4 true
dyb-fr_fr 0 p 127.0.0.1 _1c 48 175 0 5.4mb 105570 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _2 2 89 0 2mb 56578 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _7 7 49 0 1.9mb 49810 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _9 9 314 0 10.6mb 184426 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _b 11 139 0 2.7mb 66218 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _f 15 1634 0 63.3mb 916226 false true 4.10.4 false
dyb-fr_fr 1 p 127.0.0.1 _g 16 72 0 1.3mb 48850 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _n 23 67 0 2.1mb 56826 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _o 24 43 0 1009.2kb 32458 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _u 30 2097 0 55.2mb 770266 false true 4.10.4 false
dyb-fr_fr 1 p 127.0.0.1 _x 33 35 0 877.5kb 29978 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _12 38 114 0 1.9mb 46818 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _15 41 292 0 5.7mb 116850 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _16 42 2264 0 64.6mb 923826 false true 4.10.4 false
dyb-fr_fr 1 p 127.0.0.1 _17 43 193 0 5.4mb 110674 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _18 44 79 0 1.8mb 44858 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _19 45 198 0 7mb 136298 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _1a 46 170 0 5.7mb 118922 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _1b 47 173 0 6.8mb 130610 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _1c 48 162 0 3.7mb 79610 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _1d 49 205 0 7.2mb 130818 false true 4.10.4 true
dyb-fr_fr 1 p 127.0.0.1 _1e 50 171 0 5.5mb 117946 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _0 0 404 0 16mb 270562 true true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _4 4 67 0 1.4mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _b 11 12 0 168.7kb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _f 15 24 0 245.3kb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _g 16 2003 0 57.6mb 808882 true true 4.10.4 false
dyb-fr_fr 2 p 127.0.0.1 _j 19 67 0 3.4mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _l 21 100 0 2mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _o 24 136 0 3.4mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _s 28 28 0 396.9kb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _t 29 2149 0 57.6mb 822498 true true 4.10.4 false
dyb-fr_fr 2 p 127.0.0.1 _u 30 171 0 5.7mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _v 31 144 0 7mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _w 32 123 0 2.7mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _x 33 147 0 6.2mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _y 34 129 0 4.3mb 0 true false 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _13 39 32 0 1.8mb 44994 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _14 40 614 0 14mb 233474 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1f 51 44 0 676.9kb 26306 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1g 52 42 0 1.3mb 35514 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1h 53 10 0 226.5kb 19578 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1j 55 30 0 1.1mb 43706 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1k 56 53 0 1.1mb 42610 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1o 60 234 0 5.7mb 113986 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1p 61 1366 0 43mb 626498 false true 4.10.4 false
dyb-fr_fr 2 p 127.0.0.1 _1q 62 5 0 118.6kb 13162 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1r 63 78 0 7.7mb 144554 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1s 64 213 0 5.4mb 112610 false true 4.10.4 true
dyb-fr_fr 2 p 127.0.0.1 _1t 65 10 0 314kb 18122 false true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _e 14 1873 0 63.9mb 915586 true true 4.10.4 false
dyb-fr_fr 3 p 127.0.0.1 _g 16 75 0 1.6mb 40210 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _k 20 20 0 242.4kb 20426 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _o 24 74 0 2.1mb 58242 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _p 25 13 0 324.8kb 22514 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _s 28 1770 0 44.1mb 636786 true true 4.10.4 false
dyb-fr_fr 3 p 127.0.0.1 _t 29 268 0 9.5mb 171306 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _u 30 26 0 837.3kb 27474 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _v 31 50 0 3mb 73322 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _10 36 78 0 2.6mb 69178 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _14 40 306 0 6.7mb 129666 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _15 41 1751 0 58.8mb 849858 true true 4.10.4 false
dyb-fr_fr 3 p 127.0.0.1 _16 42 138 0 6.3mb 134242 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _17 43 37 0 512.7kb 24842 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _18 44 58 0 1.7mb 52410 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _19 45 286 0 5.3mb 99234 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _1a 46 202 0 7.3mb 132914 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _1b 47 53 0 1.6mb 43634 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _1c 48 111 0 3.9mb 88362 true true 4.10.4 true
dyb-fr_fr 3 p 127.0.0.1 _1d 49 79 0 1.1mb 33410 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _4 4 66 0 1.6mb 41970 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _a 10 66 0 1mb 43786 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _c 12 269 0 17.4mb 296738 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _e 14 53 0 1.1mb 33954 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _f 15 2099 0 62.3mb 866978 true true 4.10.4 false
dyb-fr_fr 4 p 127.0.0.1 _k 20 52 0 1mb 42882 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _r 27 71 0 2.4mb 51186 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _s 28 2016 0 48.8mb 689106 true true 4.10.4 false
dyb-fr_fr 4 p 127.0.0.1 _x 33 36 0 1.6mb 48210 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _10 36 247 0 2.8mb 56842 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _12 38 258 0 10.9mb 189882 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _15 41 5 0 145.7kb 13386 true true 4.10.4 true
dyb-fr_fr 4 p 127.0.0.1 _16 42 1950 0 53.3mb 749626 true true 4.10.4 false

ngrams are producing a lot of tokens.
If you index "abcdef", you will index actually:
ab,bc,cd,de,ef,abc,bcd,cde,def,abcd,bcde,cdef,abcde,bcdef,abcdef
It's even worse if you have very big strings as the combinatory explodes.

Related

Elasticsearch allocates primary shards only on first node in the cluster

I have 5 node elasticsearch cluster to store logs ( 4 master eligble and data and 1 master only node)
and all primary shards that was created allocate only on firt node in the cluster so the 1st node almost totally overloaded by cpu
why this happens? nodes have the same specs (cpu,ram,etc)
here is my cat/allocation ( i manually move shards from elastic-01 every morning, and on elastic-01 is fewer shards that on the others, but anyway load on elastic-01 is big)
shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
354 4.9tb 4.9tb 804.7gb 5.7tb 86 10.0.5.22 10.0.5.252 elastic-01
435 4tb 4tb 1.7tb 5.7tb 70 10.0.5.23 10.0.5.23 elastic-02
434 4.6tb 4.6tb 1tb 5.7tb 80 10.0.5.27 10.0.5.27 elastic-06
434 4.7tb 4.7tb 1014.8gb 5.7tb 82 10.0.5.28 10.0.5.28 elastic-07
and here is nodeattrs
node host ip attr value
elastic-07 10.0.5.28 10.0.5.28 ml.machine_memory 42002579456
elastic-07 10.0.5.28 10.0.5.28 ml.max_open_jobs 512
elastic-07 10.0.5.28 10.0.5.28 xpack.installed true
elastic-07 10.0.5.28 10.0.5.28 ml.max_jvm_size 27917287424
elastic-07 10.0.5.28 10.0.5.28 zone zone2
elastic-07 10.0.5.28 10.0.5.28 transform.node true
elastic-01 10.0.5.22 10.0.5.22 ml.machine_memory 42002583552
elastic-01 10.0.5.22 10.0.5.22 ml.max_open_jobs 512
elastic-01 10.0.5.22 10.0.5.22 xpack.installed true
elastic-01 10.0.5.22 10.0.5.22 ml.max_jvm_size 27917287424
elastic-01 10.0.5.22 10.0.5.22 zone zone1
elastic-01 10.0.5.22 10.0.5.22 transform.node true
elastic-02 10.0.5.23 10.0.5.23 ml.machine_memory 42407346176
elastic-02 10.0.5.23 10.0.5.23 ml.max_open_jobs 512
elastic-02 10.0.5.23 10.0.5.23 xpack.installed true
elastic-02 10.0.5.23 10.0.5.23 ml.max_jvm_size 27917287424
elastic-02 10.0.5.23 10.0.5.23 zone zone1
elastic-02 10.0.5.23 10.0.5.23 transform.node true
elastic-06 10.0.5.27 10.0.5.27 ml.machine_memory 42002579456
elastic-06 10.0.5.27 10.0.5.27 ml.max_open_jobs 512
elastic-06 10.0.5.27 10.0.5.27 xpack.installed true
elastic-06 10.0.5.27 10.0.5.27 ml.max_jvm_size 27917287424
elastic-06 10.0.5.27 10.0.5.27 zone zone2
elastic-06 10.0.5.217 10.0.5.27 transform.node true
elastic-11 10.0.25.24 10.0.25.24 ml.machine_memory 12428124160
elastic-11 10.0.25.24 10.0.25.24 ml.max_open_jobs 512
elastic-11 10.0.25.24 10.0.25.24 xpack.installed true
elastic-11 10.0.25.24 10.0.25.24 ml.max_jvm_size 2147483648
elastic-11 10.0.25.24 10.0.25.24 zone zone3
elastic-11 10.0.25.24 10.0.25.24 transform.node false
here is output from GET ilm/policy
{".alerts-ilm-policy":{"version":19,"modified_date":"2022-08-23T04:29:09.081Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"50gb","max_age":"30d"}}}}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[]}},".deprecation-indexing-ilm-policy":{"version":1,"modified_date":"2022-01-12T18:09:22.265Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"10gb","max_age":"14d"}}}}},"in_use_by":{"indices":[".ds-.logs-deprecation.elasticsearch-default-2022.04.06-000007",".ds-.logs-deprecation.elasticsearch-default-2022.03.09-000005",".ds-.logs-deprecation.elasticsearch-default-2022.02.09-000003",".ds-.logs-deprecation.elasticsearch-default-2022.02.23-000004",".ds-.logs-deprecation.elasticsearch-default-2022.06.29-000013",".ds-.logs-deprecation.elasticsearch-default-2022.07.13-000014",".ds-.logs-deprecation.elasticsearch-default-2022.08.10-000016",".ds-.logs-deprecation.elasticsearch-default-2022.07.27-000015",".ds-.logs-deprecation.elasticsearch-default-2022.01.26-000002",".ds-.logs-deprecation.elasticsearch-default-2022.08.24-000017",".ds-.logs-deprecation.elasticsearch-default-2022.01.12-000001",".ds-.logs-deprecation.elasticsearch-default-2022.06.15-000012",".ds-.logs-deprecation.elasticsearch-default-2022.04.20-000008",".ds-.logs-deprecation.elasticsearch-default-2022.05.04-000009",".ds-.logs-deprecation.elasticsearch-default-2022.03.23-000006",".ds-.logs-deprecation.elasticsearch-default-2022.06.01-000011",".ds-.logs-deprecation.elasticsearch-default-2022.05.18-000010"],"data_streams":[".logs-deprecation.elasticsearch-default"],"composable_templates":[".deprecation-indexing-template"]}},".fleet-actions-results-ilm-policy":{"version":1,"modified_date":"2022-01-12T17:12:45.443Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"300gb","max_age":"30d"}}},"delete":{"min_age":"90d","actions":{"delete":{"delete_searchable_snapshot":true}}}}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[]}},".items-forteforex":{"version":1,"modified_date":"2022-07-22T05:20:41.438Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb"}}}}},"in_use_by":{"indices":[".items–000001"],"data_streams":[],"composable_templates":[]}},".lists":{"version":1,"modified_date":"2022-07-22T05:20:41.356Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb"}}}}},"in_use_by":{"indices":[".lists-forteforex-000001"],"data_streams":[],"composable_templates":[]}},"180-days-default":{"version":1,"modified_date":"2022-01-12T18:09:22.121Z","policy":{"phases":{"warm":{"min_age":"2d","actions":{"forcemerge":{"max_num_segments":1},"shrink":{"number_of_shards":1}}},"cold":{"min_age":"30d","actions":{}},"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"50gb","max_age":"30d"}}},"delete":{"min_age":"180d","actions":{"delete":{"delete_searchable_snapshot":true}}}},"_meta":{"description":"built-in ILM policy using the hot, warm, and cold phases with a retention of 180 days","managed":true}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[]}},"30-days-default":{"version":1,"modified_date":"2022-01-12T18:09:22.229Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"50gb","max_age":"30d"}}},"delete":{"min_age":"30d","actions":{"delete":{"delete_searchable_snapshot":true}}},"warm":{"min_age":"2d","actions":{"forcemerge":{"max_num_segments":1},"shrink":{"number_of_shards":1}}}},"_meta":{"description":"built-in ILM policy using the hot and warm phases with a retention of 30 days","managed":true}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[]}},"365-days-default":{"version":1,"modified_date":"2022-01-12T18:09:21.893Z","policy":{"phases":{"warm":{"min_age":"2d","actions":{"forcemerge":{"max_num_segments":1},"shrink":{"number_of_shards":1}}},"cold":{"min_age":"30d","actions":{}},"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"50gb","max_age":"30d"}}},"delete":{"min_age":"365d","actions":{"delete":{"delete_searchable_snapshot":true}}}},"_meta":{"description":"built-in ILM policy using the hot, warm, and cold phases with a retention of 365 days","managed":true}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[]}},"7-days-default":{"version":1,"modified_date":"2022-01-12T18:09:22.046Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"50gb","max_age":"7d"}}},"delete":{"min_age":"7d","actions":{"delete":{"delete_searchable_snapshot":true}}},"warm":{"min_age":"2d","actions":{"forcemerge":{"max_num_segments":1},"shrink":{"number_of_shards":1}}}},"_meta":{"description":"built-in ILM policy using the hot and warm phases with a retention of 7 days","managed":true}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[]}},"90-days-default":{"version":1,"modified_date":"2022-01-12T18:09:22.192Z","policy":{"phases":{"warm":{"min_age":"2d","actions":{"forcemerge":{"max_num_segments":1},"shrink":{"number_of_shards":1}}},"cold":{"min_age":"30d","actions":{}},"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"50gb","max_age":"30d"}}},"delete":{"min_age":"90d","actions":{"delete":{"delete_searchable_snapshot":true}}}},"_meta":{"description":"built-in ILM policy using the hot, warm, and cold phases with a retention of 90 days","managed":true}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[]}},"ilm-history-ilm-policy":{"version":1,"modified_date":"2021-04-16T05:52:27.071Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb","max_age":"30d"}}},"delete":{"min_age":"90d","actions":{"delete":{"delete_searchable_snapshot":true}}}}},"in_use_by":{"indices":["ilm-history-2-000017","ilm-history-2-000016","ilm-history-2-000015","ilm-history-2-000014",".ds-ilm-history-5-2022.07.11-000010",".ds-ilm-history-5-2022.06.11-000008",".ds-ilm-history-5-2022.05.12-000006",".ds-ilm-history-5-2022.08.10-000012"],"data_streams":["ilm-history-5"],"composable_templates":["ilm-history"]}},"kibana-event-log-policy":{"version":1,"modified_date":"2021-04-23T06:56:32.286Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb","max_age":"30d"}}},"delete":{"min_age":"90d","actions":{"delete":{"delete_searchable_snapshot":true}}}}},"in_use_by":{"indices":[".kibana-event-log-7.16.2-000005",".kibana-event-log-7.16.2-000007",".kibana-event-log-7.16.2-000006",".kibana-event-log-7.16.2-000008"],"data_streams":[],"composable_templates":[".kibana-event-log-7.16.2-template"]}},"kibana-reporting":{"version":1,"modified_date":"2022-01-12T18:12:47.764Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{}}}},"in_use_by":{"indices":[".reporting-2022-08-07",".reporting-2022-06-05",".reporting-2022-08-28",".reporting-2022-05-29",".reporting-2022-03-27",".reporting-2022-05-08",".reporting-2022-01-16",".reporting-2022-08-21",".reporting-2022-01-23",".reporting-2022-09-04",".reporting-2022-05-22"],"data_streams":[],"composable_templates":[]}},"logs":{"version":1,"modified_date":"2021-04-16T05:52:26.933Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb","max_age":"30d"}}}}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":["logs"]}},"metrics":{"version":1,"modified_date":"2021-04-16T05:52:26.979Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb","max_age":"30d"}}}}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":["metrics"]}},"ml-size-based-ilm-policy":{"version":1,"modified_date":"2021-04-16T05:52:26.877Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb"}}}}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[".ml-state",".ml-stats"]}},"slm-history-ilm-policy":{"version":1,"modified_date":"2021-04-16T05:52:27.112Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_size":"50gb","max_age":"30d"}}},"delete":{"min_age":"90d","actions":{"delete":{"delete_searchable_snapshot":true}}}}},"in_use_by":{"indices":[".slm-history-2-000014",".slm-history-2-000015",".slm-history-2-000016",".slm-history-2-000017"],"data_streams":[],"composable_templates":[".slm-history"]}},"synthetics":{"version":1,"modified_date":"2022-01-12T18:09:21.976Z","policy":{"phases":{"hot":{"min_age":"0ms","actions":{"rollover":{"max_primary_shard_size":"50gb","max_age":"30d"}}}},"_meta":{"description":"default policy for the synthetics index template installed by x-pack","managed":true}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":["synthetics"]}},"watch-history-ilm-policy":{"version":1,"modified_date":"2021-04-16T05:52:27.024Z","policy":{"phases":{"delete":{"min_age":"7d","actions":{"delete":{"delete_searchable_snapshot":true}}}}},"in_use_by":{"indices":[],"data_streams":[],"composable_templates":[".watch-history-13"]}}}
nothing criminal, right?
and yeah, i have 50 indices with docs.deleted and at the moment i do force_merge 1 by one of this indices
for example this is shards that created in 03.09.2022
cat teks
lile-abz-2022.09.03 0 r STARTED 1818053 565.8mb 10.0.5.28 elastic-07
lile-abz-2022.09.03 0 p STARTED 1818053 545.6mb 10.0.5.22 elastic-01
pari-kurma-market-a-2022.09.03 0 r STARTED 9258217 5.7gb 10.0.5.27 elastic-06
pari-kurma-market-a-2022.09.03 0 p STARTED 9258217 5.7gb 10.0.5.22 elastic-01
gavn-pyati-2022.09.03 0 r STARTED 33761356 14.7gb 10.0.5.27 elastic-06
gavn-pyati-2022.09.03 0 p STARTED 33761356 14.8gb 10.0.5.22 elastic-01
gavn-pyati-3-2022.09.03 0 r STARTED 9768830 3.9gb 10.0.5.28 elastic-07
gavn-pyati-3-2022.09.03 0 p STARTED 9768830 3.9gb 10.0.5.23 elastic-02
lola-chik-a-2022.09.03 0 r STARTED 9581756 3.2gb 10.0.5.27 elastic-06
lola-chik-a-2022.09.03 0 p STARTED 9581756 3.2gb 10.0.5.22 elastic-01
lila-xyu-a-2022.09.03 0 r STARTED 1441592 605.5mb 10.0.5.27 elastic-06
lila-xyu-a-2022.09.03 0 p STARTED 1441592 603.3mb 10.0.5.23 elastic-02
gavn-pyati-1-2022.09.03 0 r STARTED 10179423 3.9gb 10.0.5.27 elastic-06
gavn-pyati-1-2022.09.03 0 p STARTED 10179423 3.9gb 10.0.5.22 elastic-01
gorilla-energ-a-2022.09.03 0 r STARTED 19341369 26.6gb 10.0.5.28 elastic-07
gorilla-energ-a-2022.09.03 0 p STARTED 19341369 26.4gb 10.0.5.23 elastic-02
chih-bimochk-a-2022.09.03 1 r STARTED 23188624 22.5gb 10.0.5.27 elastic-06
chih-bimochk-a-2022.09.03 1 p STARTED 23188624 22.4gb 10.0.5.22 elastic-01
chih-bimochk-a-2022.09.03 2 r STARTED 23181295 22.5gb 10.0.5.28 elastic-07
chih-bimochk-a-2022.09.03 2 p STARTED 23181295 22.4gb 10.0.5.22 elastic-01
chih-bimochk-a-2022.09.03 3 r STARTED 23175665 22.5gb 10.0.5.27 elastic-06
chih-bimochk-a-2022.09.03 3 p STARTED 23175665 22.4gb 10.0.5.22 elastic-01
chih-bimochk-a-2022.09.03 0 r STARTED 23182594 22.5gb 10.0.5.28 elastic-07
chih-bimochk-a-2022.09.03 0 p STARTED 23182594 22.4gb 10.0.5.22 elastic-01
prod-ca-a-2022.09.03 0 r STARTED 97339290 16.8gb 10.0.5.27 elastic-06
prod-ca-a-2022.09.03 0 p STARTED 97339290 16.8gb 10.0.5.22 elastic-01
jerusal-abracatd-a-2022.09.03 0 r STARTED 3647629 7.6gb 10.0.5.28 elastic-07
jerusal-abracatd-a-2022.09.03 0 p STARTED 3647629 7.6gb 10.0.5.22 elastic-01
prod-anstasia-a-2022.09.03 0 r STARTED 42794060 14.9gb 10.0.5.28 elastic-07
prod-anstasia-a-2022.09.03 0 p STARTED 42794060 14.9gb 10.0.5.22 elastic-01
sasha-log-2022.09.03 0 r STARTED 67602 6.5mb 10.0.5.28 elastic-07
sasha-log-2022.09.03 0 p STARTED 67602 6.5mb 10.0.5.23 elastic-02
prod-adedimitrious-a-2022.09.03 0 r STARTED 10874246 22.4gb 10.0.5.28 elastic-07
prod-adedimitrious-a-2022.09.03 0 p STARTED 10874246 22.4gb 10.0.5.22 elastic-01
as you can see almost all primaries located in elatic-01 with highest disk utiization, but nor on elastic-02 or other nodes
ADDED
i'm just create a index with 5 primary and 0 replicas and all of the primaries was allocated on elastic-01
curl -s -X GET http://10.0.5.22:9200/_cat/shards?v | grep swiss
i_want_swiss_passport 4 p STARTED 0 226b 10.0.5.22 elastic-01
i_want_swiss_passport 1 p STARTED 0 226b 10.0.5.22 elastic-01
i_want_swiss_passport 2 p STARTED 0 226b 10.0.5.22 elastic-01
i_want_swiss_passport 3 p STARTED 0 226b 10.0.5.22 elastic-01
i_want_swiss_passport 0 p STARTED 0 226b 10.0.5.22 elastic-01

Ghostscript prints blank pages

I'm trying to print PDF file to windows printers using ghostscript library.
This is my command:
gswin32c.exe -dPrinted -dBATCH -dNOPAUSE -dNOSAFER -q -dNumCopies=1 -sDEVICE=mswinpr2 -sOutputFile="\\printserver\myprinter" "C:\myfile.pdf"
This command works, I tried to print in a virtual printer (Windows PDF Printer) and it produces valid PDF.
I have some problem with a real printer using Toshiba Universal Printer Driver 2, all pages are printed completely blank (but the number of pages is right). I tried to change printer to another manufacturer and it works, so I suppose that the problem is connected to ghostscript and this particular Toshiba driver.
I tried to update this driver, I also tried to change client and I found that I have this problem only for some clients.
I tried to output some debug data with this command
gswin32c.exe -dPrinted -dDEBUG -dNumCopies=1 -sDEVICE=mswinpr2 -sOutputFile="\\printserver\myprinter" "C:\myfile.pdf"
I got this output:
START 0 1434368 139387 1309984 27572 true 582 3 <0>
GPL Ghostscript 9.23 (2018-03-21)
Copyright (C) 2018 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
END PROCS 2 1474576 176704 1330088 33388 true 705 3 <0>
END FONTDIR/ENCS 3 1514784 205041 1330088 35868 true 715 3 <0>
END DEVS 4 1532360 234258 1330088 35868 true 719 3 <0>
END STATD 5 1552464 247718 1330088 38748 true 724 3 <0>
END GS_FONTS 7 1622708 312812 1330088 38748 true 773 3 <0>
END BASIC COLOR 7 1622708 319016 1330088 38748 true 793 3 <0>
END IMAGE 8 1642812 330142 1330088 38748 true 798 3 <0>
BEGIN RESOURCES 21 2396164 1036997 1434800 144156 true 821 4 <0>
END CATEGORY 22 2396164 1040920 1434800 144444 true 822 5 <0>
END GENERIC 23 2426200 1063516 1434800 144444 true 824 4 <0>
END FIXED 24 2446304 1080587 1434800 144444 true 824 4 <0>
END MISC 25 2446304 1092183 1434800 144444 true 824 4 <0>
END ENCODING 26 2506616 1151689 1434800 148074 true 824 4 <0>
Extend MacRomanEncodingForTrueType for TrueType: insert /integral # 186
Extend MacRomanEncodingForTrueType for TrueType: cannot insert /Euro # 219 used for /currency
Extend MacRomanEncodingForTrueType for TrueType: insert /infinity # 176
Extend MacRomanEncodingForTrueType for TrueType: insert /notequal # 173
Extend MacRomanEncodingForTrueType for TrueType: insert /summation # 183
Extend MacRomanEncodingForTrueType for TrueType: insert /approxequal # 197
Extend MacRomanEncodingForTrueType for TrueType: insert /radical # 195
Extend MacRomanEncodingForTrueType for TrueType: insert /lozenge # 215
Extend MacRomanEncodingForTrueType for TrueType: insert /Omega # 189
Extend MacRomanEncodingForTrueType for TrueType: insert /pi # 185
Extend MacRomanEncodingForTrueType for TrueType: insert /product # 184
Extend MacRomanEncodingForTrueType for TrueType: insert /partialdiff # 182
Extend MacRomanEncodingForTrueType for TrueType: insert /greaterequal # 179
Extend MacRomanEncodingForTrueType for TrueType: insert /Delta # 198
Extend MacRomanEncodingForTrueType for TrueType: insert /apple # 240
Extend MacRomanEncodingForTrueType for TrueType: insert /lessequal # 178
END INITFILES 48 3724620 2302857 1434800 151334 true 1190 4 <0>
C:\Program Files (x86)\gs\gs9.23\bin/Fontmap 48 3744724 2311483 1454904 156508 true 1191 4 <1>
C:\Program Files (x86)\gs\gs9.23\lib/Fontmap 49 3784932 2343795 1454904 156508 true 1191 4 <1>
C:\Program Files (x86)\gs\gs9.23\fonts/Fontmap 49 3805036 2357477 1454904 156508 true 1191 4 <1>
%rom%Resource/Init/Fontmap 50 3805036 2367803 1454904 156508 true 1191 4 <1>
%rom%lib/Fontmap 51 3825140 2385363 1454904 156508 true 1191 4 <1>
c:/gs/gs9.23/Resource/Init/Fontmap 51 3845244 2399033 1454904 156508 true 1191 4 <1>
c:/gs/gs9.23/lib/Fontmap 52 3865348 2412693 1454904 156508 true 1191 4 <1>
c:/gs/gs9.23/Resource/Font/Fontmap 53 3865348 2423027 1454904 156508 true 1191 4 <1>
c:/gs/fonts/Fontmap 53 3885452 2436682 1454904 156508 true 1191 4 <1>
END FONTS 54 3885452 2447087 1454904 156508 true 1191 4 <0>
END DEVICE 4993 6016476 4383653 1453392 154996 true 1195 4 <0>
END CONFIG 4993 6016476 4383923 1453392 154996 true 1195 4 <0>
END INIT 4994 6096892 4457845 1566792 276716 true 1210 4 <0>
END GLOBAL 4994 6096892 4461827 1566792 279032 false 1209 4 <0>
END GC 5001 3920836 2285101 1570160 272553 false 988 3 <0>
runEPS: Not DSC
<<
/Info 22 0 R
/Root 1 0 R
/Size 23 >>
<<
/Info 22 0 R
/Root 1 0 R
/Size 23 >>
%Resolving: [1 0]
<<
/Pages 2 0 R
/Type /Catalog >>
endobj
%Resolving: [2 0]
<<
/Count 1 /Kids [
3 0 R
]
/Type /Pages >>
endobj
%Resolving: [3 0]
<<
/Contents [
20 0 R
]
/CropBox [
0.0 0.0 595.32 841.920044 ]
/MediaBox [
0.0 0.0 595.32 841.920044 ]
/Parent 2 0 R
/Resources 21 0 R
/Rotate 0 /Type /Page >>
endobj
%Resolving: [1 0]
%Resolving: [2 0]
%Resolving: [1 0]
%Resolving: [1 0]
%Resolving: [1 0]
%Resolving: [1 0]
Checking.
-dict-
-dict-
-mark-
-dict-
false
Merging.
-dict-
-dict-
-mark-
-dict-
false
Selecting.
-dict-
-dict-
-dict-
-mark-
-dict-
false
Constructing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
Putting.
[595.32 841.92]
/.MediaSize
true
/DisablePageHandler
0
/%MediaDestination
null
/LeadingEdge
0
/%MediaSource
-mark-
true
-dict-
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
Result of putting.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
Installing.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
Finishing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
%Resolving: [1 0]
%Resolving: [2 0]
Processing pages 1 through 1.
Page 1
%Resolving: [1 0]
%Resolving: [2 0]
%Resolving: [3 0]
%Resolving: [3 0]
%Resolving: [3 0]
%Resolving: [3 0]
%Resolving: [3 0]
%Resolving: [21 0]
<<
/Font <<
/F1 11 0 R
/F2 19 0 R
>>
>>
endobj
%Resolving: [21 0]
%Resolving: [21 0]
%Resolving: [2 0]
Checking.
-dict-
-dict-
-mark-
-dict-
false
-dict-
Merging.
-dict-
-dict-
-mark-
-dict-
false
-dict-
Selecting.
-dict-
-dict-
-dict-
-mark-
-dict-
false
-dict-
Constructing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
-dict-
Putting.
[595.32 841.92]
/.MediaSize
false
/PageUsesTransparency
0
/%MediaDestination
null
/LeadingEdge
0
/%MediaSource
-mark-
true
-dict-
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
-dict-
Result of putting.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
-dict-
Installing.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
-dict-
Finishing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
false
-dict-
before exec 5014 3907700 2337535 1944912 621210 false 988 7 <1>
%Resolving: [21 0]
%Resolving: [21 0]
%Resolving: [21 0]
%Resolving: [20 0]
<<
/Filter /FlateDecode /Length 205 >>
stream
%FilePosition: 214718
endobj
0.75 0.0 0.0 -0.75 0.0 841.920044 cm
q
1.0 1.0 1.0 rg
120.0 96.0 m
673.76 96.0 l
673.76 130.08 l
120.0 130.08 l
h
f
Q
q
0.0 0.0 0.0 rg
BT
0 Tr
/F1 14.7206 Tf
%Resolving: [21 0]
%Resolving: [11 0]
<<
/BaseFont /CIDFont+F1 /DescendantFonts [
<<
/BaseFont /CIDFont+F1 /CIDSystemInfo <<
/Ordering 4 0 R
/Registry 5 0 R
/Supplement 0 >>
/CIDToGIDMap /Identity /FontDescriptor <<
/Ascent 952 /CapHeight 631 /Descent -268 /Flags 6 /FontBBox 6 0 R
/FontFile2 8 0 R
/FontName /CIDFont+F1 /ItalicAngle 0 /StemV 7 0 R
/Type /FontDescriptor >>
/Subtype /CIDFontType2 /Type /Font /W 9 0 R
>>
]
/Encoding /Identity-H /Subtype /Type0 /ToUnicode 10 0 R
/Type /Font >>
endobj
runEPS: Not DSC
rewriting TempMapsNotDef
...FINISHED...
*** code space ranges ***
0
[(\000\000) (\377\377)]
*** defined charmap ***
2
[[]]
%Resolving: [4 0]
(Identity) endobj
%Resolving: [5 0]
(Adobe) endobj
%Resolving: [8 0]
<<
/Filter /FlateDecode /Length 142545 /Type /Stream >>
stream
%FilePosition: 130
endobj
DSIG 322052 7620
EBDT 65784 591
EBLC 65176 608
GDEF 129084 1558
GPOS 130644 191408
GSUB 66472 62610
OS/2 488 96
cmap 17956 700
cvt 31480 1468
fpgm 18656 3371
gasp 65160 16
glyf 32948 6652
head 364 54
hhea 420 36
hmtx 584 17372
kern 52492 66
loca 39600 12890
maxp 456 32
meta 66376 96
name 52560 12565
post 65128 32
prep 22028 9451
findname: 6 = (Calibri)
findname: 0 = (\251 2017 Microsoft Corporation. All Rights Reserved.\rHebrew OpenType Layout logic copyright \251 2003 & 2007, Ralph Hancock & John Hudson. This layout logic for Biblical Hebrew is open source software unde...)
findname: 1 = (Calibri)
findname: 4 = (Calibri)
findname: 5 = (Version 6.20)
head 236 54
hhea 290 36
maxp 326 32
OS/2 358 96
hmtx 454 17372
cmap 17826 700
fpgm 18526 3371
prep 21898 9451
cvt 31350 1468
glyf 32818 6652
loca 39470 12890
name 52360 12565
post 64926 32
GSUB 64958 62610
[236 54 36 32 96 17372 700 3372 9452 1468 6652 12890 12566 32 62610]
/FontMatrix
[1.0 0.0 0.0 1.0 0.0 0.0]
/FontBBox
[-0.502929688 -0.3125 1.24023438 1.02636719]
/FontName
(Calibri)
/FontInfo
-dict-
/XUID
[107 42 -2147483647]
FAPIhook CIDFont+F1
Trying to render the font Font CIDFont+F1 with FAPI...
Font CIDFont+F1 is being rendered with FAPI=FreeType
%Resolving: [9 0]
[
286 286 497 400 400 391 410 410 334 ]
endobj
FAPIhook CIDFont+F1
Font CIDFont+F1 is mapped to FAPI=FreeType
1 0 0.0 -1 120.0 110.08 Tm
[
(\001\232) -6.0 (\001\036) -0.558594 (\001\220) -0.113281 (\001\232) -0.960938 ]
TJ
ET
Q
q
0.0 0.0 0.0 rg
BT
0 Tr
/F2 14.7206 Tf
%Resolving: [21 0]
%Resolving: [19 0]
<<
/BaseFont /CIDFont+F2 /DescendantFonts [
<<
/BaseFont /CIDFont+F2 /CIDSystemInfo <<
/Ordering 12 0 R
/Registry 13 0 R
/Supplement 0 >>
/CIDToGIDMap /Identity /FontDescriptor <<
/Ascent 1079 /CapHeight 700 /Descent -250 /Flags 6 /FontBBox 14 0 R
/FontFile2 16 0 R
/FontName /CIDFont+F2 /ItalicAngle 0 /StemV 15 0 R
/Type /FontDescriptor >>
/Subtype /CIDFontType2 /Type /Font /W 17 0 R
>>
]
/Encoding /Identity-H /Subtype /Type0 /ToUnicode 18 0 R
/Type /Font >>
endobj
%Resolving: [12 0]
(Identity) endobj
%Resolving: [13 0]
(Adobe) endobj
%Resolving: [16 0]
<<
/Filter /FlateDecode /Length 70879 /Type /Stream >>
stream
%FilePosition: 143287
endobj
DSIG 140604 7624
GDEF 148228 808
GPOS 149036 80254
GSUB 229292 34382
LTSH 19784 5260
MERG 263804 12
OS/2 520 96
VDMX 25044 1504
cmap 115976 100
cvt 120840 2594
fpgm 116076 2652
gasp 140588 16
glyf 123436 1980
hdmx 26548 89428
head 396 54
hhea 452 36
hmtx 616 19166
kern 135932 30
loca 125416 10514
maxp 488 32
meta 263676 128
name 135964 4592
post 140556 32
prep 118728 2112
findname: 6 = (SegoeUI)
findname: 0 = (\251 2016 Microsoft Corporation. All Rights Reserved. )
findname: 1 = (Segoe UI)
findname: 4 = (Segoe UI)
findname: 5 = (Version 5.55)
head 236 54
hhea 290 36
maxp 326 32
OS/2 358 96
hmtx 454 19166
cmap 19620 100
fpgm 19720 2652
prep 22372 2112
cvt 24484 2594
glyf 27078 1980
loca 29058 10514
name 39572 4592
post 44164 32
GSUB 44196 34382
[236 54 36 32 96 19166 100 2652 2112 2594 1980 10514 4592 32 34382]
/FontMatrix
[1.0 0.0 0.0 1.0 0.0 0.0]
/FontBBox
[-0.572753906 -0.411132813 1.99902344 1.29833984]
/FontName
(SegoeUI)
/FontInfo
-dict-
/XUID
[107 42 -2147483646]
FAPIhook CIDFont+F2
Trying to render the font Font CIDFont+F2 with FAPI...
Font CIDFont+F2 is being rendered with FAPI=FreeType
%Resolving: [17 0]
[
20 20 539 ]
endobj
FAPIhook CIDFont+F2
Font CIDFont+F2 is mapped to FAPI=FreeType
1 0 0.0 -1 392.8 1022.72 Tm
[
(\000\024) -0.0625 ]
TJ
ET
Q
%Resolving: [21 0]
>>showpage, press <return> to continue<<
I had to truncate some data becase it is very long. I cannot understand this output and maybe it is not useful.
This test was made with a very simple PDF: just a "TEST" text wrote in MS Word. I tried to change PDF file but the problem is the same for all files.
What can I try to solve this problem?
The PDFDEBUG output is not useful. It would have been more useful to have given the back channel without setting PDFDEBUG.
I notice you say you 'have this problem only for some clients', which makes me think you may be using Ghostscript other than in accordance with the terms of the AGPL, you should review that before going further.
FWIW I doubt the problem is Ghostscript. All the mswinpr2 device does is render to a bitmap, draw that on the printer device context, and tell it to send itself to the printer. The simple way to tell is (on the machine with the problem) to simply have Ghostscript display the content of the test PDF file (-sDEVICE=display, or just omit it altogether). If that works, then its not Ghostscript, its something in the print pipeline.
The mswinpr2 device is very elderly, and the Windows print path has changed significantly since it was written. It may be that it simply doesn't work on Windows 10, or on some flavours of Windows 10, or some quirk of certain printer drivers on later versions of Windows doesn't work as expected.
Given the number of people I know for a fact are using the device, I'm confident that your problem is not a Ghostscript problem, as is also evident from the fact that you can get it to work on other machines.

Reading bytes from file into memory

I am using bufio to append byte arrays to a file. When I use cat on it I get:
[176 0 0 0 4 0 0 0 1 0 0 0 57 12 127 47 4 0 0 0 1 0 0 0 215 136 47 0 64 0 0 0 2 0 0 0 57 0 97 0 53 0 52 0 100 0 98 0 99 0 52 0 98 0 100 0 100 0 49 0 54 0 99 0 49 0 97 0 49 0 57 0 56 0 48 0 52 0 55 0 53 0 49 0 100 0 49 0 49 0 51 0 99 0 52 0 52 0 98 0 24 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 99 0 108 0 105 0 101 0 110 0 116 0 0 0 36 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 111 0 116 0 104 0 101 0 114 0 32 0 112 0 97 0 114 0 116 0 110 0 101 0 114 0][176 0 0 0 4 0 0 0 1 0 0 0 4 162 127 47 4 0 0 0 1 0 0 0 215 136 47 0 64 0 0 0 2 0 0 0 57 0 97 0 53 0 52 0 100 0 98 0 99 0 52 0 98 0 100 0 100 0 49 0 54 0 99 0 49 0 97 0 49 0 57 0 56 0 48 0 52 0 55 0 53 0 49 0 100 0 49 0 49 0 51 0 99 0 52 0 52 0 98 0 24 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 99 0 108 0 105 0 101 0 110 0 116 0 0 0 36 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 111 0 116 0 104 0 101 0 114 0 32 0 112 0 97 0 114 0 116 0 110 0 101 0 114 0][176 0 0 0 4 0 0 0 1 0 0 0 35 200 127 47 4 0 0 0 1 0 0 0 215 136 47 0 64 0 0 0 2 0 0 0 57 0 97 0 53 0 52 0 100 0 98 0 99 0 52 0 98 0 100 0 100 0 49 0 54 0 99 0 49 0 97 0 49 0 57 0 56 0 48 0 52 0 55 0 53 0 49 0 100 0 49 0 49 0 51 0 99 0 52 0 52 0 98 0 24 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 99 0 108 0 105 0 101 0 110 0 116 0 0 0 36 0 0 0 2 0 0 0 83 0 111 0 109 0 101 0 32 0 111 0 116 0 104 0 101 0 114 0 32 0 112 0 97 0 114 0 116 0 110 0 101 0 114 0]
So arrays of bytes. Now I want to read the file into memory, so I use:
content, err := ioutil.ReadFile(filename)
But when I display the content variable I get a completely different output than the contents of the file (and one array instead of many). What's wrong?
You wrote it wrong to the file. Its human readable format, should be binary.
My guess you used something like fmt.Fprintln(file, byte_slice) or variants.
It must be fmt.Fprintf(file, "%s", byte_slice) or similar.
Please, show us code how you write to the file.
So what think is happening is that the content inside of that file is a string. When you pull it out of the file it converts that string to bytes. What you need to do is convert those bytes to a string before you append to the file and then convert them back when you pull from the file
https://play.golang.org/p/PyBXAU9rVW

elasticsearch in yellow status

I have a two nodes elasticsearch cluster with logstash and kibana. The cluster was on green status until I have started the logstash the elasticsearch cluster went to yellow status.
running curl -XGET http://localhost:9200/_cat/shards?pretty
will show the following
.kibana 0 p STARTED 2 8.2kb 172.17.0.1 Ereshkigal
.kibana 0 r UNASSIGNED
logstash-2015.10.18 4 r STARTED 69 101.9kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 4 p STARTED 69 101.7kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.18 0 r STARTED 62 65.7kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 0 p STARTED 62 89.4kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.18 3 p STARTED 76 48.1kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 3 r UNASSIGNED
logstash-2015.10.18 1 p STARTED 74 78.8kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 1 r UNASSIGNED
logstash-2015.10.18 2 r STARTED 79 56.8kb 172.17.0.1 Ereshkigal
logstash-2015.10.18 2 p STARTED 79 65.1kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 4 p STARTED 7 43.4kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 4 r UNASSIGNED
logstash-2015.10.19 0 r STARTED 7 50.8kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 0 p STARTED 7 58.3kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 3 r STARTED 9 67.4kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 3 p STARTED 9 67.3kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 1 r STARTED 12 76.4kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 1 p STARTED 12 13.8kb 172.17.0.2 Hargen the Measurer
logstash-2015.10.19 2 p STARTED 13 78kb 172.17.0.1 Ereshkigal
logstash-2015.10.19 2 r UNASSIGNED
How can I get the cluster back in green status?
Yellow means you have unassigned shards, as shown by your output.
Make sure your shard allocation is enabled:
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "all"
}
}'
You can also try forcing the shard onto a node:
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html

Metric to compute and compare RAM and CPU usage in Android

I have two versions of Android that I'm testing on a device, both differ in few services in AOSP. I wanted to take some sort of a bench mark test to see how much the new system services are consuming my RAM and CPU usage. I'm not sure how to begin with. Are there any existing benchmarks that achieve the same? If not how should I proceed in this case.
Any help is appreciated
You could run some of my CPU and memory benchmarks (free, no adds) via
http://www.roylongbottom.org.uk/android%20benchmarks.htm
Also, you could install Android Terminal Emulator from Google Play and use Linux commands for top or vmstat to monitor resources used (at least they work on my tablet).
Below are details from vmstat whilst running one of my benchmarks.
Command vmstat -d 1 -n 60 > /mnt/extsd/vmst3.txt
For 60 samples of one second to txt file on external SD card
via path as identified by the df command
Command cat /mnt/extsd/vmst3.txt to display details
Start this, switch to main display, execute MemSpeed.apk that uses up
to 65 MB over nearly 11 seconds (starts in 16 seconds after a bit of
fiddling that uses some system CPU time). Note free memory reduction
and 99% CPU utilisation for 10+ seconds. Idle time is clearly wrong.
procs memory system cpu
r b free mapped anon slab in cs flt us ni sy id wa ir
0 0 909092 124948 197812 17600 365 554 0 3 0 2 99 0 0
1 0 906052 124704 200544 17600 2176 3162 0 21 0 27 99 0 0
0 0 905968 125700 200660 17596 1175 4000 0 15 0 21 99 0 0
0 0 905968 125716 200672 17596 286 397 0 1 0 2 99 0 0
0 0 905968 125716 200672 17596 1528 1226 0 5 0 6 99 0 0
0 0 905160 124944 201276 17596 1533 4771 0 30 0 31 99 0 0
0 0 905224 124944 201288 17596 349 460 0 3 0 4 99 0 0
0 0 904588 125440 201984 17596 2721 6542 0 32 0 30 99 0 0
0 0 903844 124964 202820 17596 2266 3569 0 25 0 17 99 0 0
3 0 903720 126456 202860 17596 1924 6185 0 37 0 37 99 0 0
1 0 897768 126504 202228 17596 2281 3661 0 29 0 20 99 0 0
0 0 894296 134684 202308 17596 1437 4258 0 18 0 21 99 0 0
0 0 894296 134700 202308 17596 521 631 0 4 0 7 99 0 0
1 0 894296 134700 202308 17596 300 420 0 1 0 3 99 0 0
0 0 894296 134700 202308 17596 320 417 0 0 0 4 99 0 0
2 0 846820 142512 205780 17596 2273 3369 0 38 0 37 99 0 0
0 0 846764 142492 205836 17616 1044 3101 0 23 0 21 99 0 0
1 0 838960 142492 205804 17616 1661 974 0 49 0 8 99 0 0
1 0 838960 142500 205908 17616 540 464 0 99 0 0 99 0 0
1 0 838836 142504 205924 17616 515 444 0 99 0 0 98 0 0
procs memory system cpu
r b free mapped anon slab in cs flt us ni sy id wa ir
1 0 838836 142504 205960 17616 521 442 0 99 0 1 99 0 0
1 0 838712 142504 206140 17616 458 348 0 99 0 0 99 0 0
1 0 838464 142504 206392 17616 479 373 0 99 0 0 99 0 0
1 0 837968 142504 206900 17616 598 646 0 99 0 1 99 0 0
1 0 834992 142504 209900 17616 688 772 0 99 0 2 96 0 0
1 0 823088 142504 221928 17616 500 484 0 98 0 4 97 0 0
1 0 774852 142504 269888 17616 447 366 0 95 0 6 97 0 0
1 0 774852 142504 269900 17616 391 315 0 99 0 1 98 0 0
0 0 774852 142504 269900 17616 401 477 0 51 0 4 99 0 0
0 0 774728 142504 269932 17616 231 240 0 0 0 1 99 0 0
0 0 774728 142504 269932 17616 219 239 0 0 0 0 99 0 0
0 0 774728 142504 269932 17616 214 243 0 0 0 1 99 0 0
0 0 774728 142504 269932 17616 196 222 0 0 0 0 99 0 0
0 0 797028 144488 270676 17616 2621 6371 0 40 1 35 99 0 0
0 0 797092 144560 270768 17612 466 801 0 1 0 7 99 0 0
1 0 796564 146172 271020 17648 1548 1657 0 14 0 7 99 0 0
1 0 796500 144044 271088 17648 1157 2890 0 10 0 12 99 0 0
0 0 796564 144044 271096 17648 367 503 0 2 0 4 99 0 0
0 0 796564 144044 271096 17648 343 438 0 2 0 4 99 0 0
0 0 796564 144044 271096 17648 275 348 0 3 0 3 99 0 0
procs memory system cpu
r b free mapped anon slab in cs flt us ni sy id wa ir
0 0 796564 144044 271096 17648 227 274 0 0 0 1 99 0 0
0 0 796564 144044 271096 17648 300 363 0 2 0 2 99 0 0
0 0 796564 144044 271096 17648 273 344 0 1 0 1 99 0 0
0 0 796564 144044 271096 17648 238 284 0 0 0 2 99 0 0
0 0 796564 144044 271096 17648 311 344 0 3 0 5 99 0 0
1 0 796564 144044 271096 17648 246 289 0 1 0 0 99 0 0
1 0 796564 144044 271096 17648 263 322 0 2 0 2 99 0 0
0 0 796564 144044 271096 17648 275 335 0 2 0 2 99 0 0
0 0 796564 144044 271096 17648 442 460 0 1 0 4 99 0 0
0 0 796564 144044 271096 17648 451 417 0 3 0 7 99 0 0
0 0 796564 144044 271096 17648 284 345 0 2 0 1 99 0 0
0 0 796564 144044 271096 17648 310 375 0 1 0 2 99 0 0
0 0 796564 144044 271096 17648 278 339 0 1 0 2 99 0 0
0 0 796564 144044 271100 17648 282 350 0 2 0 1 99 0 0
0 0 796564 144044 271100 17648 242 284 0 2 0 2 99 0 0
0 0 796564 144044 271100 17648 293 352 0 1 0 2 99 0 0
0 0 796564 144044 271100 17648 343 511 0 8 0 2 99 0 0
0 0 796564 144044 271120 17648 198 221 0 0 0 1 99 0 0
0 0 796564 144044 271120 17648 227 263 0 0 0 0 99 0 0
0 0 796564 144044 271120 17648 230 246 0 1 0 2 99 0 0

Resources