> Ok I can see that I do not generate a lot of attention with this
> problem, so could someone at least tell me if it is a normal behaviour
> for Scalaris to use this quantity of RAM for strings that sums up to
> less than 620Mb on the disk?
> At 8000 files inserted, the total RAM used by Scalaris on the 3
> nodes was more than 13Gb!
We store 4 replicas: makes 2.5 GB
If you store strings, they are linked lists in Erlang with a single
byte and a pointer to the next element.
If you use 64bit machine, this makes: 2.5 * (1 + 8) = 22.5 GB
If you use 32bit machine, this makes: 2.5 * (1 + 4) = 12.5 GB
Regards,
Florian
anwers compiled from earlier posts:
Our java-api only reads and writes strings. If you want to write
binary data, you will need to extend the Main.java (or write your
own). You need to write a wrapper class that extends CustomOtpObject
(see CustomOtpFastStringObject in the examples directory) and maps a
Java-type to an Erlang-type. Then you can use
Scalaris/Transaction.writeCustom with such an object which will write
it to a running Scalaris ring.
Reading works analogously.
Regarding the partitioning, you can place nodes on the ring
explicitly. To create a symmetric Scalaris ring with two resp. four
nodes:
on PC1:
./bin/scalarisctl -k 0 boot start
on PC2:
./bin/scalarisctl -k 170141183460469231731687303715884105728 node start
if you want to add two more nodes, they would have to have the following keys:
on PC3:
./bin/scalarisctl -k 85070591730234615865843651857942052864 node start
on PC4:
./bin/scalarisctl -k 255211775190703847597530955573826158592 node start
Florian
[dory.thibault]
> Thank you for your answer Florian, that is very nice of you :)
>
> The machines are indeed 64bit and that explains why so much RAM is
> used.
> Would it be possible to store the same information using a different
> type to use less memory?
> For example is there a way to create an OtpErlangObject that contains
> all bytes in one sequence instead of a linked list?
>
> I have observed that the repartition of data changes everytime I
> restart the cluster, it seems to be random. Is it possible to tell
> scalaris to split the data in equal size between the nodes? With the
> current way the nodes join the ring, some of them takes a lot of data
> under their responsibility and therefore run out of memory very fast
> while other nodes have plenty of free memory but only store a small
> part of the data.
>
> Thibault
>
> On 3 d�c, 16:38, Florian Schintke <schin...@gmail.com> wrote:
> > Yes, its normal...
> >
> > > Ok I can see that I do not generate a lot of attention with this
> > > problem, so could someone at least tell me if it is a normal behaviour
> > > for Scalaris to use this quantity of RAM for strings that sums up to
> > > less than 620Mb on the disk?
> > > At 8000 files inserted, the total RAM used by Scalaris on the 3
> > > nodes was more than 13Gb!
> >
> > We store 4 replicas: makes 2.5 GB
> >
> > If you store strings, they are linked lists in Erlang with a single
> > byte and a pointer to the next element.
> >
> > If you use 64bit machine, this makes: 2.5 * (1 + 8) = 22.5 GB
> > If you use 32bit machine, this makes: 2.5 * (1 + 4) = 12.5 GB
> >
> > Regards,
> >
> > Florian
>
> --
> You received this message because you are subscribed to the Google Groups "scalaris" group.
> To post to this group, send email to scal...@googlegroups.com.
> To unsubscribe from this group, send email to scalaris+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/scalaris?hl=en.
Florian
the CustomOtpFastStringObject class in our examples directory could do the job for you - just be advised to use the same architecture on all machines. The class is simply using the bytes from the Java string and the writes them into an OtpErlangBinary.
> > > The machines are indeed 64bit and that explains why so much RAM is
> > > used.
> > > Would it be possible to store the same information using a different
> > > type to use less memory?
> > > For example is there a way to create an OtpErlangObject that contains
> > > all bytes in one sequence instead of a linked list?
We have recently decided to (internally) compress all values into binaries
before transferring and storing them in Scalaris. Recent Scalaris trunk
checkouts include that change and for those you can now still use ordinary
strings and won't get too much memory overhead. In fact due to the
compression, memory use will even be less than the (uncompressed) strings.
> > > I have observed that the repartition of data changes everytime I
> > > restart the cluster, it seems to be random. Is it possible to tell
> > > scalaris to split the data in equal size between the nodes? With the
> > > current way the nodes join the ring, some of them takes a lot of data
> > > under their responsibility and therefore run out of memory very fast
> > > while other nodes have plenty of free memory but only store a small
> > > part of the data.
Passive load balancing should do that job for you and is enabled by default
now. It first tries to split address ranges uniformly during join. If the
existing nodes have had contact to the other nodes for a while and aggregated
the average load in the system (gossip), they will split the actual load
instead of the address space.
Please check if your problem still occurs.
Nico