Calls to _aliases very slow

Anyone have an idea on why calls to /_aliases would be slow while most
other calls are fast?

Each call takes around ~2s wether it's a single add action:

curl -XPOST 'http://elastic.server:9200/_aliases?' -d
'{"actions":[{"add":{"index":"index_name","alias":"alias_name","routing":123,"filter":{"term":{"site_id":123}}}}]}'

or multiple actions:

curl -XPOST 'http://elastic.server:9200/_aliases?' -d '
{
"actions" : [

{"add":{"index":"index_one","alias":"index_alias_one","routing":1,"filter":{"term":{"site_id":1}}}},

{"add":{"index":"index_two","alias":"index_alias_two","routing":1,"filter":{"term":{"site_id":0}}}},

{"add":{"index":"index_three","alias":"index_alias_three","routing":1,"filter":{"term":{"site_id":1}}}}
]
}'

--

On Thursday, 13 September 2012 19:53:33 UTC+2, Bryan Brunetti wrote:

Anyone have an idea on why calls to /_aliases would be slow while most
other calls are fast?

I'm seeing the same behaviour, with all alias-updating calls taking ~10
seconds. This is on a single-node cluster (OpenJDK 1.7.0_07) and ES 0.19.7.
It doesn't seem to happen on all machines I've tested, though. I initially
suspected something to do with replicas, but those are set to 0. Health is
reported as OK, no unassigned_shards or similar.

Did you get any further with this?

Klaus

--

On Wednesday, 17 October 2012 09:30:26 UTC+2, Klaus Brunner wrote:

I'm seeing the same behaviour, with all alias-updating calls taking ~10
seconds. This is on a single-node cluster (OpenJDK 1.7.0_07) and ES 0.19.7.
It doesn't seem to happen on all machines I've tested, though. I initially
suspected something to do with replicas, but those are set to 0. Health is
reported as OK, no unassigned_shards or similar.

Okay, I've finally narrowed it down to alias requests of this form, where
there's a matching remove and add:

POST http://localhost:9200/_aliases
{
"actions" : [
{ "remove" : { "index" : "foo", "alias" : "bla" } },
{ "add" : { "index" : "foo", "alias" : "bla" } }
]
}

That's admittedly a bit of a pathological case, but if anything, I'd expect
an error, not a long delay.

Klaus

--

Hello!

I don't think we should see error in such case. You've sent a proper request, however it seems that it took a bit longer for ES to add and than remove the same alias.

--

Regards,

Rafał Kuć

Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch

On Wednesday, 17 October 2012 09:30:26 UTC+2, Klaus Brunner wrote:

I'm seeing the same behaviour, with all alias-updating calls taking ~10 seconds. This is on a single-node cluster (OpenJDK 1.7.0_07) and ES 0.19.7. It doesn't seem to happen on all machines I've tested, though. I initially suspected something to do with replicas, but those are set to 0. Health is reported as OK, no unassigned_shards or similar.

Okay, I've finally narrowed it down to alias requests of this form, where there's a matching remove and add:

POST http://localhost:9200/_aliases

{

"actions" : [


    { "remove" : { "index" : "foo", "alias" : "bla" } },


    { "add" : { "index" : "foo", "alias" : "bla" } }


]

}

That's admittedly a bit of a pathological case, but if anything, I'd expect an error, not a long delay.

Klaus

--

On Thursday, 18 October 2012 16:11:59 UTC+2, Rafał Kuć wrote:

Hello!

I don't think we should see error in such case. You've sent a proper
request, however it seems that it took a bit longer for ES to add and than
remove the same alias.

That's okay, but a delay of 10 seconds is quite problematic (and I'm now
able to reproduce this on all machines, every time). I guess it runs into
some kind of silly loop.

Klaus

--

I tried to recreate it, and the only time it happens (it waits for 10s, which is the timeout it waits to get validation that it actually been applied across the cluster) is when you the alias actions end up not actually changing anything, like removing and adding an alias that already exists (resulting in actual 0 change in aliases). Here is the issue: Aliases API times out when actions end up with no actual change to aliases · Issue #2345 · elastic/elasticsearch · GitHub, should be fixed shortly.

On Oct 19, 2012, at 8:54 AM, Klaus Brunner klaus.brunner@gmail.com wrote:

On Thursday, 18 October 2012 16:11:59 UTC+2, Rafał Kuć wrote:
Hello!

I don't think we should see error in such case. You've sent a proper request, however it seems that it took a bit longer for ES to add and than remove the same alias.

That's okay, but a delay of 10 seconds is quite problematic (and I'm now able to reproduce this on all machines, every time). I guess it runs into some kind of silly loop.

Klaus

--

--