gontard
gontard

Reputation: 29510

OrientDB performance testing disable cache

I have written some performance testing on an embedded orientdb database v1.7.7.

The same query is executed several times. The first query execution take some times but the subsequent executions are much more faster.

I guess that OrientDB is caching a lot of things. So i want to disable the cache.

The documentation on orientdb caching says that:

OGlobalConfiguration.CACHE_LOCAL_ENABLED.setValue(false);

I had to adapt this code since this configuration property does not exists, so i wrote:

OGlobalConfiguration.CACHE_LEVEL1_ENABLED.setValue(false);
OGlobalConfiguration.CACHE_LEVEL2_ENABLED.setValue(false);

But even with this configuration my problem remains. The first query execution take some times but the subsequent executions are much more faster.

Upvotes: 2

Views: 1295

Answers (1)

Lvca
Lvca

Reputation: 9060

This is because the DiskCache. Look at that as a replacement of the Operative System's Memory Mapping. It handles loading/saving of pages from RAM to Disk:

https://github.com/orientechnologies/orientdb/wiki/plocal-storage-disk-cache

You can change it by setting the global configuration "DISK_CACHE_SIZE" with the size you want to allocate in MB. Do this this before to use OrientDB:

OGlobalConfiguration.DISK_CACHE_SIZE.setValue( 1000 ); // 1GB 

This setting is per-database, so if you have multiple database (not multiple users against the same database) you should assign it properly.

Upvotes: 2

Related Questions