▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/DatabaseTester
DatabaseTester

DatabaseTester

Tests your server's database connections from in-game and shows how fast they answer. MySQL, MariaDB, PostgreSQL, SQL Server, SQLite, H2, MongoDB and Redis, with the config re-read on every run.

Оцените первым
30
0

DatabaseTester

Checks that your server can actually reach its databases, and tells you how fast they answer.

Point it at whatever your plugins use, run /database test, and you get a per-database report: driver, connect time, ping, round trip latency and an optional read/write check. config.yml is read from disk on every single run, so you can fix a password, run the command again, and see the result without a reload or a restart.

Supported databases

Type keyDatabaseTalks over
mysqlMySQLJDBC
mariadbMariaDBJDBC
postgresqlPostgreSQLJDBC
sqlserverMicrosoft SQL ServerJDBC
sqliteSQLiteJDBC, file based
h2H2JDBC, file based
mongodbMongoDBmongodb-driver-sync
redisRedis and ValkeyJedis

Every driver is bundled. Nothing to install, nothing to download at startup.

Commands

CommandPermissionDescription
/database testdatabasetester.testTest every enabled database
/database test <name>databasetester.testTest one database, even a disabled one
/database listdatabasetester.useShow what is configured
/database typesdatabasetester.useShow the supported type keys

Aliases are /db and /dbtest. All permissions default to operators.

What a test does

  1. Driver loads the JDBC driver or client for the configured type.
  2. Connect opens a fresh connection and times it.
  3. Ping runs SELECT 1, a Mongo ping command or a Redis PING.
  4. Latency repeats that round trip a few times and reports min, average and max.
  5. Write test creates a throwaway table, collection or key, writes a row, reads it back, deletes it and drops the container again. Turn it off if the account is read only.

Everything runs off the server thread, one database after another, under a hard timeout. A database that hangs cannot stall the server or the rest of the run.

The first run after a restart is slower than the rest, because the driver classes are loaded during it. Read the second run for real numbers, not the first.

Tested against

Every type below was tested against a live server on Paper 1.21.11 and Java 21, write test included: MySQL 8.4.6 (caching_sha2_password), MariaDB 11.4.4, PostgreSQL 16.15, SQL Server 2022 (16.0.4275), SQLite 3.49.1, H2 2.3.232, MongoDB 8.0.4 and Redis 7.4.1.

One number from that run is worth repeating, because it is the kind of thing this plugin exists to surface: the same SQLite write test took 6 ms on ext4 and 3.4 seconds on an NTFS volume. The database was fine; the filesystem underneath it was not.

Configuration

Each entry under databases is one target, and the key is the name you pass to /database test <name>. The file shipped with the plugin explains every option inline.

settings:
  connect-timeout-seconds: 5
  query-timeout-seconds: 5
  latency-samples: 5
  write-test: true
  test-table-prefix: dbtester_
  log-to-console: true

databases:
  survival-mysql:
    enabled: true
    type: mysql
    host: localhost
    port: 3306
    database: minecraft
    username: root
    password: ''
    properties:
      useSSL: false

properties is handed to the driver untouched, so anything the driver accepts works. For connections those fields cannot express, set url instead and it replaces host, port and database.

SQLite and H2 take a file instead of a host. Relative paths resolve against the server directory, so plugins/SomePlugin/database.db points at another plugin's database and lets you check it without touching that plugin. Redis numbers its databases, so its database field takes a number as a string, and username is only needed for Redis 6 ACL users.

Requirements

Paper 1.20 or newer on Java 21. Folia is supported. Spigot is not, because the plugin uses Paper's global region scheduler to hand results back to the server thread.

Партнёрский материал

Сервер для плагина DatabaseTester - как у профи

Плагин DatabaseTester создан для серверов: на своём сервере вы настраиваете его под себя и решаете, кому играть. Создать сервер с плагином DatabaseTester для друзей можно за пару минут - BungeeHost всё уже подготовил.

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

26.3.x26.2.x26.1.x1.21.x1.20.x

Поддерживаемые окружения

Сервер

Ссылки

Детали

Лицензия:
Опубликован:2 месяца назад
Обновлён:1 месяц назад
Главная