In-memory indices


(rcch) #1

Hi all,

  1. I set up an index with -Des.index.storage.type=memory.
  2. I added a bunch of documents.
  3. Then, I killed elastic search
  4. I brought it back up and queried the index - and the searches were
    sucessful.

I believe there's a gap in my understanding. If the index is an in-
memory index - I thought there is no persistence in this case. But
seems like there is a built in layer of persistence. I use the default
configuration (did not set up a gateway, etc).

So the questions are:

  1. Is there persistence for in-memory indices ? If not, how did my
    example work ?

  2. What happens if I go over the index limit for an in-memory index ?
    Will ES gracefully transition between keeping things in RAM and going
    to diske or will it die ?

  3. How do I set up a hybrid where I keep a considerable amount of
    stuff in RAM (cached) and go to diske when needed?

Thank you for your help.

Cheers,

Vijay


(Karussell) #2

in-memory means that ES will nevertheless makes backup (via local
gateway) of the data to recover from that in a case of an incident.
But if the data does not fit completely into memory ES will throw at
some point OutOfMem errors. No 'transition' is done.

What you probably want is the default disc base index, which is also
in-memory for parts of the data (ES does a lot caching but also the
Operating system) and so it'll require less RAM and reads from disc if
the data is not cached

Regards,
Peter.

On 16 Sep., 03:41, rcch vijay....@gmail.com wrote:

Hi all,

  1. I set up an index with -Des.index.storage.type=memory.
  2. I added a bunch of documents.
  3. Then, I killed elastic search
  4. I brought it back up and queried the index - and the searches were
    sucessful.

I believe there's a gap in my understanding. If the index is an in-
memory index - I thought there is no persistence in this case. But
seems like there is a built in layer of persistence. I use the default
configuration (did not set up a gateway, etc).

So the questions are:

  1. Is there persistence for in-memory indices ? If not, how did my
    example work ?

  2. What happens if I go over the index limit for an in-memory index ?
    Will ES gracefully transition between keeping things in RAM and going
    to diske or will it die ?

  3. How do I set up a hybrid where I keep a considerable amount of
    stuff in RAM (cached) and go to diske when needed?

Thank you for your help.

Cheers,

Vijay


(Shay Banon) #3

There is no persistency with in memory indices and local gateway, only with
shared gateway. Are you sure you got results? Also, did you do a full
cluster shutdown (if you are running more than one node)?

Note, there are bugs in the in memory (outside of JVM heap) store which I
did not manage yet to track down. Use the file system ones, or mmapfs, it
should be fast enough. If not, you can set the store to "ram" which defaults
to Lucene in memory (in heap) memory store.

On Fri, Sep 16, 2011 at 11:36 AM, Karussell tableyourtime@googlemail.comwrote:

in-memory means that ES will nevertheless makes backup (via local
gateway) of the data to recover from that in a case of an incident.
But if the data does not fit completely into memory ES will throw at
some point OutOfMem errors. No 'transition' is done.

What you probably want is the default disc base index, which is also
in-memory for parts of the data (ES does a lot caching but also the
Operating system) and so it'll require less RAM and reads from disc if
the data is not cached

Regards,
Peter.

On 16 Sep., 03:41, rcch vijay....@gmail.com wrote:

Hi all,

  1. I set up an index with -Des.index.storage.type=memory.
  2. I added a bunch of documents.
  3. Then, I killed elastic search
  4. I brought it back up and queried the index - and the searches were
    sucessful.

I believe there's a gap in my understanding. If the index is an in-
memory index - I thought there is no persistence in this case. But
seems like there is a built in layer of persistence. I use the default
configuration (did not set up a gateway, etc).

So the questions are:

  1. Is there persistence for in-memory indices ? If not, how did my
    example work ?

  2. What happens if I go over the index limit for an in-memory index ?
    Will ES gracefully transition between keeping things in RAM and going
    to diske or will it die ?

  3. How do I set up a hybrid where I keep a considerable amount of
    stuff in RAM (cached) and go to diske when needed?

Thank you for your help.

Cheers,

Vijay


(Karussell) #4

There is no persistency with in memory indices and local gateway, only with
shared gateway.

After some digging deeper now I think I have a better understanding.
So @Vijay sorry for the confusion. @shay is the following assumption/
explanation correct?

When using local gateway the index is simply stored on disc and when
restarting the node it will use this information and the transaction
log to recover the index, right? If the index is stored in-memory then
there is no data to recover from.

When using shared gateway there is an additional storage (periodically
writing to this storage?). Then the node can simply recover the in-
memory index from that storage.

Now how does the transaction log comes into the game here? Does it
exist for in-memory indices at all?

Regards,
Peter.


(Karussell) #5

One further question: to force Elasticsearch to recover from the local
disc for an in-memory index then I can simply use the shared gateway
with the default local work directory, right? I'm a bit confused of
the gateway naming (local vs. shared ...)

On 18 Sep., 14:08, Karussell tableyourt...@googlemail.com wrote:

There is no persistency with in memory indices and local gateway, only with
shared gateway.

After some digging deeper now I think I have a better understanding.
So @Vijay sorry for the confusion. @shay is the following assumption/
explanation correct?

When using local gateway the index is simply stored on disc and when
restarting the node it will use this information and the transaction
log to recover the index, right? If the index is stored in-memory then
there is no data to recover from.

When using shared gateway there is an additional storage (periodically
writing to this storage?). Then the node can simply recover the in-
memory index from that storage.

Now how does the transaction log comes into the game here? Does it
exist for in-memory indices at all?

Regards,
Peter.


(Shay Banon) #6

Yes, when using a shared gateway, periodically, the state of the indices are
persisted to the shared storage location. Transaction log is still in play
when using in memory indices since they play important part not just in
making sure indexed data does not get lost, but also when doing both shared
gateway persistency (snapshot), and when doing peer shard recovery.

On Sun, Sep 18, 2011 at 3:08 PM, Karussell tableyourtime@googlemail.comwrote:

There is no persistency with in memory indices and local gateway, only
with
shared gateway.

After some digging deeper now I think I have a better understanding.
So @Vijay sorry for the confusion. @shay is the following assumption/
explanation correct?

When using local gateway the index is simply stored on disc and when
restarting the node it will use this information and the transaction
log to recover the index, right? If the index is stored in-memory then
there is no data to recover from.

When using shared gateway there is an additional storage (periodically
writing to this storage?). Then the node can simply recover the in-
memory index from that storage.

Now how does the transaction log comes into the game here? Does it
exist for in-memory indices at all?

Regards,
Peter.


(Karussell) #7

Thanks for the explantion and confirmation.

but also when doing both shared gateway persistency (snapshot)

But when doing local gateway (for an in memory index) there is no
snapshot thing, right?

and when doing peer shard recovery

What do you mean here?


(Shay Banon) #8

On Sun, Sep 18, 2011 at 6:54 PM, Karussell tableyourtime@googlemail.comwrote:

Thanks for the explantion and confirmation.

but also when doing both shared gateway persistency (snapshot)

But when doing local gateway (for an in memory index) there is no
snapshot thing, right?

Right, local gateway does not need to snapshot since it can recover from the
actual state of the indices.

and when doing peer shard recovery

What do you mean here?

When you increase the shards replicas, or shard migrate from one node to
another, they do recovery from one another. Thats what I mean by peer
recovery.


(Karussell) #9

Thanks! makes sense!

On 18 Sep., 18:27, Shay Banon kim...@gmail.com wrote:

On Sun, Sep 18, 2011 at 6:54 PM, Karussell tableyourt...@googlemail.comwrote:

Thanks for the explantion and confirmation.

but also when doing both shared gateway persistency (snapshot)

But when doing local gateway (for an in memory index) there is no
snapshot thing, right?

Right, local gateway does not need to snapshot since it can recover from the
actual state of the indices.

and when doing peer shard recovery

What do you mean here?

When you increase the shards replicas, or shard migrate from one node to
another, they do recovery from one another. Thats what I mean by peer
recovery.


(system) #10