Skip to content
pop4959 edited this page Mar 18, 2023 · 2 revisions

Tests

Tests are a core function of the Stress plugin. You can find information and recommendations on how to run various tests here.

All stress test commands begin with /stress test=<test>. Only one test is intended to be run at a time.

Chunk Generation

This test generates chunks for an entire region. There must not be any chunks in the selected region that are already generated. Prints out information about how long it took, and TPS information.

Parameter descriptions:

rx (optional) Region x coordinate (between -58593 and 58593) to generate. Defaults to a random value.

rz (optional) Region y coordinate (between -58593 and 58593) to generate. Defaults to a random value.

world (optional) The world to generate a region in. Defaults to the primary server world.

Examples:

/stress test=chunkgen generates a random region in the primary world.

/stress test=chunkgen world=world_nether rx=12345 rz=-12345 generates region 12345,-12345 in world_nether.

Chunk Load

This test loads chunks for an entire region. All chunks in the region must already have been generated. The chunk generation test can be run before this one to guarantee that there are chunks to load. Prints out information about how long it took.

Parameter descriptions:

rx (optional) Region x coordinate (between -58593 and 58593) to generate. Defaults to the value last used in the chunk generation test, or 1 if not run.

rz (optional) Region y coordinate (between -58593 and 58593) to generate. Defaults to the value last used in the chunk generation test, or 1 if not run.

world (optional) The world to generate a region in. Defaults to the value last used in the chunk generation test, or the primary server world if not run.

Examples:

/stress test=chunkload loads chunks for the last region generated or 1,1 in the primary server world.

/stress test=chunkload rx=5 rz=10 world=world loads chunks for region 5,10 in world.

Command

This test measures how long it takes for a command to finish executing on the main server thread. Commands that are in part asynchronous may appear to finish after the test completes, and this is normal.

Parameter descriptions:

command (required) The command to run, using comma separators (or other if configured) instead of spaces.

separator (optional) The command separator to use. Defaults to , (comma).

source (optional) The command source. May be console, or an online player. Defaults to the test sender.

Examples:

/stress test=command command=me,says,hello executes and times the command /me says hello.

/stress test=command command=say,hello source=console executes and times the command /say hello as console.

/stress test=command command=home source=pop4959 executes and times the command /home as pop4959 (if online).

/stress test=command command=stress,test=command,command=me|says|hello,separator=| executes and times the command /stress test=command command=me|says|hello separator=|.

Entity

This test is intended to measure lag caused by adding additional entities to the server, in a relatively safe manner. The player is not able to move while this test is running, as it relies heavily on entity activation range and despawn range in order to produce correct results. Entities will not drop items, and should not cause damage to the world (although, additional protection plugins are recommended in order to guarantee this).

Parameter descriptions:

amount (optional) The number of entities to spawn. It is highly recommended to gradually increase this rather than immediately skip to an extremely high value, as this may cause a server crash. Defaults to 100.

duration (optional) The time, in seconds, for this test to run. The player running the test will be unable to move for this duration. Very low values may produce less accurate results. Defaults to 10.

entity (optional) The entity to spawn. Defaults to pig.

range (optional) The distance in blocks from the player that entities will randomly spawn in. This must be within the player's render distance. Defaults to 0.

Examples:

/stress test=entity amount=1000 duration=5 range=10 spawns 1000 pigs in a radius of 10 blocks from the player for 5 seconds.

/stress test=entity entity=villager duration=5 range=10 amount=1000 spawns 1000 villagers in a radius of 10 blocks from the player for 5 seconds.

Ticks

This test is simply intended to print out the last few server ticks, up to 1200 (1 minute). Intended to be used to catch a glimpse of lag spikes.

Parameter descriptions:

count (optional) The number of ticks to print out. Defaults to 20 (1 second).

Examples:

/stress test=ticks prints out the last 20 ticks (1 second).

/stress test=ticks count=200 prints out the last 200 ticks (10 seconds).

TPS

This test is intended to print out detailed information for various time intervals, as configured. Displays the TPS, minum tick duration, average tick duration, maximum tick duration, and standard deviation tick duration.

The TPS (ticks per second) is an overall metric for server health. Normally 20 TPS. Lower values indicate the server may be running slower than expected (lagging), while higher values may indicate that the server is recovering from lag, and running faster ticks to catch up.

Ticks should take no longer than 50 ms to compute. A single tick that takes significantly longer may be noticeable as a lag spike. If it takes less time, the server will wait until running the next tick (as it is ahead of schedule), which is good.

The minimum tick duration is the fastest tick that the server ran in the given time interval. The average tick duration represents about how long a random tick usually takes. The maximum tick duration is the slowest tick that the server ran in the given time interval. The standard deviation tick duration indicates how much the tick duration tends to vary from the average.

Parameter descriptions:

ticks (optional) The exact number of ticks to calculate TPS information from.

interval (optional) A specific interval to print TPS information from.

Examples:

/tps or /stps or /stress test=tps will print out TPS information for all configured intervals.

/stress test=tps ticks=600 will print out TPS information for the last 600 ticks (30 seconds).

/stress test=tps interval=shortest will print out TPS information for the shortest configured interval.

Clone this wiki locally