NAV Navbar
json
  • Introduction
  • ItalianCannon
  • Introduction

    Welcome to KruinWorks Apps Wiki! A complete Wiki about the usage and setup instructions of Apps developed by KruinWorks.

    Copyright (C) 2017 - 2018 The KruinWorks.

    ItalianCannon

    ItalianCannon is a powerful, portable, compact and easy-to-use HTTP server performance tester.

    Installation

    Directly Run with Code

    Make sure you have these following prerequirements installed:

    Clone the latest ItalianCannon git repository.

    git clone https://github.com/KruinWorks/ItalianCannon.git --depth=1

    Enter directory, and run this following command:

    cd ./ItalianCannon && dotnet restore && dotnet run

    ItalianCannon will automatically generate the example configurations (ItalianCannon.json) file for you. Edit and then try to run this command to start ItalianCannon:

    dotnet run

    Compile ItalianCannon Yourself

    Do these operations above (Don't forget dotnet restore). But don't execute dotnet run.

    Run dotnet publish --configuration Release instead.

    Then, by default, .NET Core SDK will compile ItalianCannon to ./ItalianCannon/bin/Release/ItalianCannon.dll

    Find the ItalianCannon.dll, then run dotnet ItalianCannon.dll.

    Use Pre-compiled Binary

    Make sure to install Microsoft .NET Core before going on.

    We had written a script for you to install ItalianCannon easily. Run this command to install ItalianCannon directly.

    wget https://raw.githubusercontent.com/KruinWorks/ItalianCannon/master/install.sh && chmod +x ./install.sh && ./install.sh

    If you want to start ItalianCannon, use this command:

    cd ./ItalianCannon && dotnet ItalianCannon.dll

    Configuration

    Configurations, Explained

    Here we shows the default configurations file (ItalianCannon 1.0.7).

    {
      "Note": "Please change 'AppearsToBeDefault' to False after changing settings. ItalianCannon will ignore this configuration entry. For headers help, see https://see.wtf/O5vFp",
      "TeaCupTargets": [
        {
          "Url": "https://www.contoso.com",
          "Threads": 1
        }
      ],
      "IntervalPerThread": 500,
      "MaxRequestsPerThread": 1000,
      "UserAgent": "Mozilla/5.0 (Linux) AppleWebKit/888.88 (KHTML, like Gecko) Chrome/66.6.2333.66 Safari/233.33",
      "AppearsToBeDefault": true,
      "DisableSSLValidation": false,
      "IgnoreHTTPError": false,
      "ExtraHTTPHeaders": [
        {
          "HType": 10,
          "Content": "GET"
        }
      ],
      "EnableAnimations": false,
      "EnableColors": true,
      "SilentMode": false,
      "RandomPOST": false,
      "RandomPOSTRate": 1,
      "RandomPOSTLength": 0,
      "RandomHEAD": false,
      "RandomHEADRate": 1,
      "RandomQuery": false
    }
    

    This following table will show you the description for each item:

    Name Data Type Description
    Note String By default, it will be ignored by ItalianCannon, but do not leave it blank.
    TeaCupTargets Array A collection of request target.
    - URL URI The request URL.
    - Threads Int32 The quantity of request threads.
    IntervalPerThread Int32 (Milliseconds) Indicates how long should a thread wait before next request.
    MaxRequestsPerThread Int32 Indicates how many requests should a thread make before stopping.
    UserAgent String Content of HTTP User-Agent Header.
    AppearsToBeDefault Boolean Used to notify the user to configure ItalianCannon before running. MUST be set to false.
    DisableSSLValidation Boolean Whether ItalianCannon should go on or not, when the server responded with an invalid SSL/TLS certificate.
    IgnoreHTTPError Boolean Whether ItalianCannon should ignore HTTP 4xx/5xx status codes or not.
    ExtraHTTPHeaders Array Extra HTTP Headers sent along with the requests.
    - HType Int32 Header type, see https://see.wtf/O5vFp for numeric IDs.
    - Content String Header content.
    EnableAnimations Boolean Enable animations to get a direct view of status and statistics.
    EnableColors Boolean Enables colored outputs.
    SilentMode Boolean Disable most of the info outputs.
    RandomPOST Boolean Send POST requests randomly.
    RandomPOSTRate Byte (0~100) The probability of sending POST requests.
    RandomPOSTLength Int32 Data length of POST requests.
    RandomHEAD Boolean Send HEAD requests randomly.
    RandomHEADRate Byte (0~100) The probability of sending HEAD requests.
    RandomQuery Boolean Appends a random query to each request url.

    Examples

    You want to try http://domain.tld and https://domain.tld

    "TeaCupTargets": [
        {
          "Url": "http://domain.tld",
          "Threads": 1
        },
        {
          "Url": "https://domain.tld",
          "Threads": 1
        }
      ],
    ...
    

    ... This site didn't supply a valid TLS Certificate but you still wanted to continue:

    "DisableSSLValidation": true,
    

    ... Continue requesting even if the server is responding errors:

    "IgnoreHTTPError": true,
    

    ... Send 256-bytes' POST requests randomly with 50% probability:

    "RandomPOST": true,
    "RandomPOSTRate": 50,
    "RandomPOSTLength": 256,
    

    ... Add some cookies to make it more sweet:

    "ExtraHTTPHeaders": [
      {
        "HType": 25,
        "Content": "logged_in=yes"
      },
      {
        "HType": 25,
        "Content": "userid=ffffffff-ffff-ffff-ffff-ffffffffffff"
      }
    ],
    

    Request domain.tld resolved as 192.168.10.91

    ...
    "TeaCupTargets": [
      {
        "Url": "http://192.168.10.91",
        "Threads": 1
      }
    ],
    ...
    "ExtraHTTPHeaders": [
      {
        "HType": 28,
        "Content": "domain.tld"
      }
    ],
    ...
    

    Improving Performance

    Avoid Running Directly with Code

    ItalianCannon is based on .NET Core, which is actually a JIT language.

    Because of this, ItalianCannon may significantly slow down when using commands like dotnet run. Because corefx needs to compile it "realtimely". This will eat up a huge amount of CPU resource.

    Compile ItalianCannon yourself, or use pre-compiled binary files. Descriptions could be found in the Installation section.

    Try Silent Mode

    Console output sometimes eats up performance, too.

    To improve performance, try to change "SilentMode": false to "SilentMode": true in the configurations file.

    Decrease DNS Lookups

    Bind IP Addresses with Domains to improve performance. There's already a sample above in the Configuration section.

    Use a Reasonable Threads Quantity

    Using a reasonable threads quantity can decrease RAM usage, meanwhile, improves the application performance.

    Disable Random Query Feature

    Enabling this feature will make ItalianCannon generate a new random query with every request.

    Disable it to speed up.

    Known Issues