spark 1.3.0

spark is a performance profiling plugin based on sk89q's WarmRoast profiler.

  1. Luck
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    Source Code:
    https://github.com/lucko/spark
    Contributors:
    sk89q
    [​IMG]
    spark is a performance profiling plugin based on sk89q's WarmRoast profiler.
    What does it do?
    spark is made up of a number of components, each detailed separately below.

    ⚡ CPU Profiler (process sampling)
    [​IMG]
    This is the primary component of spark - a lightweight CPU sampler with corresponding web analysis view based on WarmRoast.

    The sampler records statistical data about which actions take up the most processing time. These statistics can then be used to diagnose potential performance issues with certain parts of the server or specific plugins.

    Once the data has been recorded, a "call graph" can be formed and displayed in a web browser for analysis.

    A profiler like the one in spark will not magically fix "lag" - they are merely a tool to help diagnose the cause of poor performance.

    ⚡ Tick Monitor (server tick monitoring)

    This component monitors the speed at which the game server is processing "ticks". Can be used to spot trends and identify the nature of a performance issue, relative to other system events. (garbage collection, game actions, etc)

    ⚡ Memory Inspection (heap analysis & GC monitoring)
    [​IMG]
    This component provides a function which can be used to take basic snapshots of system memory usage, including information about potentially problematic classes, estimated sizes and instance counts corresponding to objects in the JVM.

    Unlike the other "profiler"-like functionality in spark, this component is not intended to be a full replacement for proper memory analysis tools. It just shows a simplified view.

    spark also includes functionality which allows "full" hprof snapshots to be taken. These can be then analysed with conventional memory analysis tools.

    ⚡ Server Health reporting
    [​IMG]

    Information about the servers current "health" can be viewed in-game using commands. The output contains information about:
    • Server TPS (ticks per second) information, to a much more accurate degree than indicated by the /tps command.
    • CPU usage of the server process, as well as the overall system
    • Memory usage
    • Disk usage

    Usage
    To install, just add the spark.jar file to your servers plugins directory.
    In order to use any of the commands, you need to have the 'spark' permission.

    Exact command usages are detailed at the bottom of this page.

    If you’d like help analysing a profiling report, or just want to chat, feel free to join us on Discord.

    Guides
    There are a few small "guide" wiki pages available on GitHub, covering the following topics.

    About
    WarmRoast features

    These features are carried over from the upstream "WarmRoast" project.
    • The viewer is entirely web-based — no specialist software is required to view the output, just a web browser!
    • Output is arranged as a stack of nested method calls, making it easy to interpret the output
    • Nodes can be expanded and collapsed to reveal timing details and further child nodes.
    • The overall CPU usage and contribution of a particular method can be seen at a glance.
    • See the percentage of CPU time for each method relative to its parent methods.
    • Sampling frequency can be adjusted.
    • Virtually no overheads or side effects on the target program (the server)
    spark features
    WarmRoast is an amazing tool for server admins, but it has a few flaws.
    • It is not accessible to some users, because in order to use it, you need to have direct SSH (or equivalent) access to the server. (not possible on shared hosts)
    • It can be somewhat clunky to setup and start (typical steps: ssh into server machine, open up ports / disable firewall rules?, start process, identify target VM, allow profiler to run for a bit, open a web browser & navigate to the temporary web page hosted by the application. not ideal!)
    • It's not easy to share profiling data with other developers or admins.
    • Java Development Kit must be installed on the target machine.
    I've attempted to address these flaws in spark.
    • Profiling is managed entirely using in-game or console commands.
    • You don't need to have direct access to the server machine - just install the plugin as you would normally.
    • Data is uploaded to a "pastebin"-esque site to be viewed - a temporary web server is not needed, and you can easily share your analysis with others!
    • It is not necessary to install any special Java agents or provide a path to the Java Development Kit
    Other benefits of spark compared with other profilers:
    • MCP (Mod Coder Pack) deobfuscation mappings can be applied to method names directly in the viewer
      • This works for both partially deobfuscated Bukkit mappings, as well as for Sponge/Forge (Searge) mappings
    • No specialist software is required to view the output, just a web browser.
    spark vs "Real Profilers"

    The spark (WarmRoast) profiler operates using a technique known as sampling. A sampling profiler works by probing the target programs call stack at regular intervals in order to determine how frequently certain actions are being performed. In practice, sampling profilers can often provide a more accurate picture of the target program's execution than other approaches, as they are not as intrusive to the target program, and thus don't have as many side effects.

    Sampling profiles are typically less numerically accurate and specific than other profiling methods (e.g. instrumentation), but allow the target program to run at near full speed.

    The resultant data is not exact, but a statistical approximation. The accuracy of the output improves as the sampler runs for longer durations, or as the sampling interval is made more frequent.

    spark vs "Minecraft Timings"

    Aikar's timings system (built into Spigot) is similar to spark/WarmRoast, in the sense that it also analyses the CPU activity of the server.

    timings will generally be slightly more accurate than spark, but is (arguably?!) less useful, as each area of analysis has to be manually defined.

    For example, timings might identify that a certain listener in plugin x is taking up a lot of CPU time processing the PlayerMoveEvent, but it won't tell you which part of the processing is slow. spark/WarmRoast on the other hand will show this information, right down to the name of the method call causing the bad performance.

    Commands
    All commands require the 'spark' permission.

    /spark start
    Starts a new profiling operation.

    Arguments:
    • --info
      • Prints information about the active profiler, if present.
    • --stop
      • Ends the current profiling operation, uploads the resultant data, and returns a link to the viewer.
    • --cancel
      • Cancels the current profiling operation, and discards any recorded data without uploading it.
    • --timeout <timeout>
      • Specifies how long the profiler should run before automatically stopping. Measured in seconds.
      • If left unspecified, the profiler will run indefinitely, until it is stopped
    • --thread <thread name>
      • Specifies the name of the thread to be profiled.
      • If left unspecified, the profiler will only sample the main "server thread".
      • The * character can be used in place of a name to mark that all threads should be profiled
    • --regex
      • Specifies that the set of threads defined should be interpreted as regex patterns.
    • --combine-all
      • Specifies that all threads should be combined into a single node.
    • --not-combined
      • Specifies that threads from a pool should not be combined into a single node.
    • --interval <interval>
      • Specifies the interval between samples. Measured in milliseconds.
      • Lower values will improve the accuracy of the results, but may result in server lag.
      • If left unspecified, a default interval of 10 milliseconds is used.
    • --only-ticks-over <tick length millis>
      • Specifies that entries should only be included if they were part of a tick that took longer than the specified duration to execute.
    • --include-line-numbers
      • Specifies that line numbers of method calls should be recorded and included in the sampler output.
    /spark tps
    Prints information about the servers TPS (ticks per second) rate.

    /spark healthreport
    Generates a health report for the server.

    Arguments
    • --memory
      • Specifies that additional information about the JVMs memory usage should be included
    /spark tickmonitoring
    Starts/stops the tick monitoring system.

    Arguments:
    • --threshold <percentage increase>
      • Specifies the report threshold, measured as a percentage increase from the average tick duration.
    • --without-gc
      • Specifies that GC notifications should not be shown.

    /spark heapsummary
    Creates a new memory (heap) dump summary, uploads the resultant data, and returns a link to the viewer.

    Arguments:
    • --run-gc-before
      • Specifies that before recording data, spark should suggest that the system performs garbage collection.

    /spark heapdump
    Creates a new heapdump (.hprof snapshot) file and saves to the disk.

    Arguments:
    • --run-gc-before
      • Specifies that before recording data, spark should suggest that the system performs garbage collection.
    • --include-non-live
      • Specifies that "non-live" objects should be included. (objects that are not reachable from others)
    /spark activity
    Prints information about recent activity performed by the plugin.

Recent Updates

  1. 1.3.0
  2. 1.2.0
  3. 1.1.0

Recent Reviews

  1. freakdk
    freakdk
    5/5,
    Version: 1.3.0
    Very helpfull tool, have been using this to monitor performance for quite some time now. Very easy to use and a lot less hassle than similar software that is run outside of Spigot. :)
  2. jet315
    jet315
    5/5,
    Version: 1.3.0
    In terms of detecting what piece of code is causing lag, this is far superior to any Timings.
    Incredibly useful to use as a developer!
  3. HexedHero
    HexedHero
    5/5,
    Version: 1.3.0
    Better than vanilla and sometimes even paper timings, great work and a good heap outputter
  4. jessepm123
    jessepm123
    5/5,
    Version: 1.3.0
    Incredibly useful plugin from an incredibly useful developer! Thanks for all the work on creating spark!
  5. Govindas
    Govindas
    5/5,
    Version: 1.2.0
    amazing plugin, helped me identify some of my Skript code performance issues! I think this plugin is useful for every server.
  6. pinkpig
    pinkpig
    5/5,
    Version: 1.1.0
    Very useful plugin. Thanks for making this! I definitely recommend!
    Awesome plugin like always.
  7. SlimeDog
    SlimeDog
    5/5,
    Version: 1.0.4
    Outstanding profiler plugin! Unbelievably great! Like pretty much everything Luck produces. Keep it going...
  8. BrooklynStarr
    BrooklynStarr
    5/5,
    Version: 1.0.4
    AMAZING TOOL!! I was going nuts trying to get Warmroast to work when I found this. It helped me drill down to the exact cause of lag on my server and I was able to eliminate within a short period of time. THANK YOU!!
  9. MicleBrick
    MicleBrick
    5/5,
    Version: 1.0.4
    Great plugin, does what it says and has unique tools for finding the cause of short lag spikes.
  10. Matin_Dark
    Matin_Dark
    5/5,
    Version: 1.0.4
    Really i don't know what should i say the only thing i can tell luck is best developer i ever seen his plugins are so useful and cool!