@Override public void contextInitialized(ServletContextEvent sce) { if (OGlobalConfiguration.INIT_IN_SERVLET_CONTEXT_LISTENER.getValueAsBoolean()) { OLogManager.instance().infoNoDb(this, "Start web application is detected, OrientDB engine is staring up..."); Orient.startUp(true); OLogManager.instance().infoNoDb(this, "OrientDB engine is started"); } }
/** * Tries to fix some common cache/memory configuration problems: <ul> <li>Cache size is larger than direct memory size.</li> * <li>Memory chunk size is larger than cache size.</li> <ul/> */ public static void fixCommonConfigurationProblems() { long diskCacheSize = OGlobalConfiguration.DISK_CACHE_SIZE.getValueAsLong(); final int max32BitCacheSize = 512; if (getJavaBitWidth() == 32 && diskCacheSize > max32BitCacheSize) { OLogManager.instance() .infoNoDb(OGlobalConfiguration.class, "32 bit JVM is detected. Lowering disk cache size from %,dMB to %,dMB.", diskCacheSize, max32BitCacheSize); OGlobalConfiguration.DISK_CACHE_SIZE.setValue(max32BitCacheSize); } }
OLogManager.instance().infoNoDb(this, "cgroup hard memory limit is %d B/%d MB/%d GB", cgroupMemoryLimitValue, convertToMB(cgroupMemoryLimitValue), convertToGB(cgroupMemoryLimitValue)); if (cgroupMemoryLimitValueStr.matches("\\d+")) { if (printSteps) { OLogManager.instance().infoNoDb(this, "cgroup hard memory limit is not set"); OLogManager.instance().infoNoDb(this, "Can not read memory hard limit for cgroup '%s'", memoryCGroup);
OLogManager.instance().infoNoDb(this, "Detected limit of amount of simultaneously open files is %d, " + " limit of open files for disk cache will be set to %d", rlimit.rlim_cur, rlimit.rlim_cur / 2 - 512); } else { if (verbose) { OLogManager.instance().infoNoDb(this, "Can not detect value of limit of open files."); if (verbose) { OLogManager.instance() .infoNoDb(this, "Windows OS is detected, %d limit of open files will be set for the disk cache.", recommended); OLogManager.instance().infoNoDb(this, "Default limit of open files (%d) will be used.", defLimit);
OLogManager.instance().infoNoDb(this, "cgroup soft memory limit is %d B/%d MB/%d GB", cgroupMemoryLimitValue, convertToMB(cgroupMemoryLimitValue), convertToGB(cgroupMemoryLimitValue)); if (cgroupMemoryLimitValueStr.matches("\\d+")) { if (printSteps) { OLogManager.instance().infoNoDb(this, "cgroup soft memory limit is not set"); OLogManager.instance().infoNoDb(this, "Can not read memory soft limit for cgroup '%s'", memoryCGroup);
final File dirFile = new File(directoryPath); if (!dirFile.exists()) { OLogManager.instance().infoNoDb(this, "Directory " + dirFile + " does not exist, try to create it."); OLogManager.instance().infoNoDb(this, "WAL maximum segment size is set to %,d MB", maxWALSegmentSize / 1024 / 1024); } catch (IOException e) { throw OException.wrapException(new ODatabaseException("Cannot initialize OrientDB engine"), e);
private void configureDefaults() { if (!OGlobalConfiguration.DISK_CACHE_SIZE.isChanged()) { configureDefaultDiskCacheSize(); } else { final long diskCacheInMB = OGlobalConfiguration.DISK_CACHE_SIZE.getValueAsInteger(); OLogManager.instance().infoNoDb(null, "OrientDB config DISKCACHE=%,dMB", diskCacheInMB); } if (!OGlobalConfiguration.WAL_RESTORE_BATCH_SIZE.isChanged()) configureDefaultWalRestoreBatchSize(); }
@Override public void contextDestroyed(ServletContextEvent sce) { if (OGlobalConfiguration.INIT_IN_SERVLET_CONTEXT_LISTENER.getValueAsBoolean()) { final Orient orient = Orient.instance(); if (orient != null) { OLogManager.instance().infoNoDb(this, "Shutting down of OrientDB engine because web application is going to be stopped"); orient.shutdown(); OLogManager.instance().shutdown(); } } } }
private static int getOpenFilesLimit() { if (OGlobalConfiguration.OPEN_FILES_LIMIT.getValueAsInteger() > 0) { OLogManager.instance().infoNoDb(OEngineLocalPaginated.class, "Limit of open files for disk cache will be set to %d.", OGlobalConfiguration.OPEN_FILES_LIMIT.getValueAsInteger()); return OGlobalConfiguration.OPEN_FILES_LIMIT.getValueAsInteger(); } final int defaultLimit = 512; final int recommendedLimit = 256 * 1024; return ONative.instance().getOpenFilesLimit(true, recommendedLimit, defaultLimit); }
.infoNoDb(this, "%d B/%d MB/%d GB of physical memory were detected on machine", memoryLimit, convertToMB(memoryLimit), convertToGB(memoryLimit)); OLogManager.instance().infoNoDb(this, "Soft memory limit for this process is set to %d B/%d MB/%d GB", rlimit.rlim_cur, convertToMB(rlimit.rlim_cur), convertToGB(rlimit.rlim_cur)); OLogManager.instance().infoNoDb(this, "Hard memory limit for this process is set to %d B/%d MB/%d GB", rlimit.rlim_max, convertToMB(rlimit.rlim_max), convertToGB(rlimit.rlim_max)); OLogManager.instance().infoNoDb(this, "Path to 'memory' cgroup is '%s'", memoryCGroupPath); OLogManager.instance().infoNoDb(this, "Mounting path for memory cgroup controller is '%s'", memoryCGroupRoot); OLogManager.instance().infoNoDb(this, "Can not find '%s' path for memory cgroup, it is supposed that " + "process is running in container, will try to read root '%s' memory cgroup data", memoryCGroup, memoryCGroupRoot); if (memoryLimit > 0) OLogManager.instance() .infoNoDb(this, "Detected memory limit for current process is %d B/%d MB/%d GB", memoryLimit, convertToMB(memoryLimit), convertToGB(memoryLimit)); else OLogManager.instance().infoNoDb(this, "Memory limit for current process is not set");
@Override public void startup() { final String userName = System.getProperty("user.name", "unknown"); OLogManager.instance().infoNoDb(this, "System is started under an effective user : `%s`", userName); OMemoryAndLocalPaginatedEnginesInitializer.INSTANCE.initialize(); super.startup(); readCache = new O2QCache(calculateReadCacheMaxMemory(OGlobalConfiguration.DISK_CACHE_SIZE.getValueAsLong() * 1024 * 1024), OGlobalConfiguration.DISK_CACHE_PAGE_SIZE.getValueAsInteger() * 1024, true, OGlobalConfiguration.DISK_CACHE_PINNED_PAGES.getValueAsInteger(), OGlobalConfiguration.DISK_CACHE_PRINT_CACHE_STATISTICS.getValueAsBoolean(), OGlobalConfiguration.DISK_CACHE_STATISTICS_INTERVAL.getValueAsInteger()); }
this.allowDirectIO = true; OLogManager.instance() .infoNoDb(this, "Direct IO for WAL located in %s is allowed with block size %d bytes.", walLocation.toString(), blockSize); } else { OLogManager.instance().infoNoDb(this, "Page size for WAL located in %s is set to %d bytes.", walLocation.toString(), pageSize);
private OLogSequenceNumber restoreFromFuzzyCheckPoint(final OFuzzyCheckpointStartRecord checkPointRecord) throws IOException { OLogManager.instance().infoNoDb(this, "Data restore procedure from FUZZY checkpoint is started."); OLogSequenceNumber flushedLsn = checkPointRecord.getFlushedLsn(); if (flushedLsn.compareTo(writeAheadLog.begin()) < 0) { OLogManager.instance().errorNoDb(this, "Fuzzy checkpoint points to removed part of the log, " + "will try to restore data from the rest of the WAL", null); flushedLsn = writeAheadLog.begin(); } return restoreFrom(flushedLsn, writeAheadLog); }
OLogManager.instance().infoNoDb(this, "JVM can use maximum %dMB of heap memory", jvmMaxMemory / (1024 * 1024)); OLogManager.instance().infoNoDb(this, "Because OrientDB is running inside a container %s of memory will be left unallocated according to the setting '%s'" + " not taking into account heap memory", OGlobalConfiguration.MEMORY_LEFT_TO_CONTAINER.getValueAsString(), OGlobalConfiguration.MEMORY_LEFT_TO_CONTAINER.getValueAsString()) - jvmMaxMemory) / (1024 * 1024); } else { OLogManager.instance().infoNoDb(this, "Because OrientDB is running outside a container %s of memory will be left " + "unallocated according to the setting '%s' not taking into account heap memory", OGlobalConfiguration.MEMORY_LEFT_TO_OS.getValueAsString(), OGlobalConfiguration.MEMORY_LEFT_TO_OS.getKey()); .infoNoDb(null, "OrientDB auto-config DISKCACHE=%,dMB (heap=%,dMB os=%,dMB)", diskCacheInMB, jvmMaxMemory / 1024 / 1024, osMemory.memoryLimit / 1024 / 1024); .infoNoDb(null, "OrientDB config DISKCACHE=%,dMB (heap=%,dMB os=%,dMB)", diskCacheInMB, jvmMaxMemory / 1024 / 1024, osMemory.memoryLimit / 1024 / 1024);
.infoNoDb(this, "Storage '%s' is created under OrientDB distribution : %s", getURL(), OConstants.getVersion());
.infoNoDb(this, "Storage '%s' is opened under OrientDB distribution : %s", getURL(), OConstants.getVersion());