Large amount of clusters created for a document
OrientDB Version, operating system, or hardware.
- v2.2.13
Operating System
- [x] Linux
- [x] MacOSX
Expected behavior and actual behavior
I am using Java API to create schemas and write data to documents. I do not explicitly create any clusters. When I write data to a document I can see that multiple clusters are created for a document. On the file system I see files documentName_{n}.cpm and documentName_{n}.cpl. I assume that a file ending with _{n}.cpl/cpm represents a cluster for that document. When I run the program on OS X it only creates 3-4 of such files however when I run it on a large linux box (128GB or RAM, 4 CPUs, 10 cores), there are large amount of such files being created which eventually leads to the following messages in the logs. The data I am writing to the document is not very large.
c.o.o.c.s.cache.local.twoq.O2QCache : $ANSI{green {db=rodmondb}} Maximum amount of pinned pages is reached , given page OReadCacheEntry{fileId=7810331515912465944, pageIndex=0, dataPointer=OCachePointer{referrersCount=1, usagesCount=0}, dirty=true, usagesCount=1} will not be marked as pinned which may lead to performance degradation. You may consider to increase percent of pined pages by changing of property storage.diskCache.pinnedPages
Steps to reproduce the problem
n/a
I came across this information in the OrientDB docs:
"By default, OrientDB creates one cluster for each Class. Starting from v2.2, OrientDB automatically creates multiple clusters per each class (the number of clusters created is equals to the number of CPU's cores available on the server) to improve using of parallelism."
This however seems to cause performance problems on a large linux box where there is 40 cores. Is it possible to disable this feature and let OrientDB use only 1 cluster for a class?
Yes, it is possible with this command.
ALTER DATABASE MINIMUMCLUSTERS 1
http://orientdb.com/docs/last/SQL-Alter-Database.html
Edit: I just realized that this command is actually poorly labeled. It should be MAXIMUMCLUSTERS.
Scott
Just found it too, was a bit confused with the label.
I set the value to 1 and works ok now.
Thanks, Tomas
Hi @tomvit
I'd suggest you to set it to 2 or 4, it will give you some speedup in multi-thread insert/update operations, because of some cluster level locks
Thanks
Luigi
@luigidellaquila - is the number of clusters increasing in 3.0?
Also, if there is a perfomance issue with 40 clusters, it might be a good idea to default to some other number other than just "cores = clusters".
Scott
In my app I have 10 threads each creating documents in their own set of 13 classes by using OrientDB Java API. On 4 cores box all works ok, on 40 cores box, the system was not able to write data to documents at all or was very very slow in which case I had to stop it. I also observed the message in the logs suggesting to increase pinnedPages to a higher value than 20 which did not help.
If you have different hw/sw configuration I can confirm that the selection of the number of clusters has to be done at the beginning, so you have the same database no matter the number of cores. Unless you have many classes (and therefore clusters), and if your target cfg has 40 cores, then 8 or 16 are both good numbers.