Open Source RDBMS - Seamless, Scalable, Stable and Free

English | Login |Register

Advanced Controller Configuration


This chapter describes the advanced nGrinder controller configuration. Most time, you don't need to read this guide. However if you want to run nGrinder as the cloud based service or calibrate the behavior, you should read this chapter.

${NGRINDER_HOME} - nGrinder Controller Home

If you start tomcat with "catalina.sh start" or "startup.sh", nGrinder will create .ngrinder folder into user’s home folder after it start up successfully. it contains the configuration files and data.
.ngrinder default data location is following.

  • Window; C:\Users\{userhome}\.ngrinder
  • Unix/Linux; /home/{username}/.ngrinder

But if you assign the other folder as ngrinder home, please set Environment Variables “NGRINDER_HOME” before running tomcat.

Advanced Configuration

${NGRINER_HOME} has followings

  • database.conf – This contains the database configuration. You can modify this file when you need to use the other DB. The default DB nGrinder uses is H2.
    database=H2
    database_username=admin
    database_password=admin

    NOTE: If you like to use Cubrid for database, you need to add following configuration more

    database_url={your_cubrid_host_ip_or_name}:{cubrid_port_maybe_33000}:{dbname}

    NOTE: If you want to duplicate Cubrid DB with HA. Please enables HA in cubrid following the link and add the alternatives db address in database.conf

    database_url_option=&althosts={you_cubrid_secondary_host_ip_or_name}:{cubrid_port_maybe_33000}
  • NOTE: Currently, we just support 2 types of database, H2,and Cubrid. If you want to use other DB, please modify the class org.ngrinder.infra.config.Database to add a new one, like Mysql or request to use to support it. In later version, we will make more flexible to use other type of DB.

  • system.conf – This file contains the general policy and configuration for nGrinder controller. You can specify your settings to provide more securities or capacities in nGrinder.

    Name

    Since

    Default Value

    Description

    verbose

    3.0

    false

    Set verbose mode to print the more detailed log.

    security

    3.0.1

    false

    You can specify whether nGrinder controller uses security mode or not. When the security mode is activated, Each test script is limited to access limited range of targets. Please refer Script Security

    agent.max.size

    3.0

    10

    The maximum number of agents which can be attached into one test. This is useful when you like to make nGrinder shared by more user. Each test can be assigned only limited number of agents. So If your nGrinder instance has 15 agents in total and you set this field 5, you can guarantee 3 users can run performance test concurrently.

    agent.max.vuser

    3.0

    100

    The maximum number of vuser which can be created per one agent. If your agent machine spec is good enough, you can increase this.

    agent.max.runcount

    3.0

    10000

    The maximum runcount of test per ech agent.

    agent.max.hour

    3.0

    8

    The maximum running hour of etest

    ngrinder.console.portbase

    3.0

    12000

    The starting port number of console which will be mapped to each test.

    You need to restart nGrinder to apply the this configuration.

    ngrinder.max.concurrenttest

    3.0

    10

    How many concurrent tests are allowed in ngrinder.

    ngrinder.max.waitingmilliseconds

    3.0

    5000

    How much milliseconds console will be waiting until all agents are connected.

    ngrinder.frontpage.rss

    3.0

    http://www.cubrid.org/
    wiki_ngrinder/rss

    You can point your own rss page on the ngrinder first page.

    ngrinder.help.url 3.1 http://www.cubrid.org/
    wiki_ngrinder/entry/user-guide
    If you want to provide your own custom help page. please modify this
    ngrinder.langauge.default 3.1 en language default en/kr/cn is available. This is useful when you're installing custom SSO plugin.
    ngrinder.security.sha256 3.1 false

    By default, ngrinder uses sha1 to encode password. If you ned shar256, please set true.

    You need to reinstall nGrinder to apply the this configuration.

    ngrinder.dist.logback 3.1.1 true

    To be compatible with old agents (before 3.1.1), please set following to true. 
    If you use the latest version of agents, just set it false.

    ngrinder.dist.safe 3.1.1 false

    From 3.1.1, nGrinder doesn't check the file distribution result to speed up the test execution.
    If your agent is located in the far places or you distribute big files everyday, you'd better to change this to true.

    ngrinder.dist.safe.region 3.1.1 false

    If some region has the slow connection speed, it may need the safe distribution in force.

    ngrinder.dist.safe.threashhold 3.1.1 1000000

    Set the safe distribution threshold to enable safe distribution for specific transfer size in force.

    The followings are related to the clustering. It should be very carefully set.
    # You can refer http://www.cubrid.org/wiki_ngrinder/entry/controller-clustering-guide
    ngrinder.cluster.mode 3.1 false

    if you want to enable ngrinder controller clustering. please enable this with true.

    You need to restart nGrinder to apply the this configuration.

    ngrinder.cluster.uris 3.1 none

    cache cluster uri of all clustered controller servers. only the controller and agents in same region will work together.

    You need to restart nGrinder to apply the this configuration.

    ngrinder.cluster.listener.port 3.1 40003

    cache cluster listener port

    You need to restart nGrinder to apply the this configuration.

  • process_and_thread_policy.js – This file defines the logic to determine process and thread assignment policy.

    This file provides the flexibility to configure default process and thread allocation scheme.
    User ususally don’t know which process and thread combination provides the best performance.
    Therefore, nGrinder let user just input expected vuser per agent and configure the process and thread count automatically.
    With some experiments we found out that half of CPU core count in agents is best for the process count. However in some environment, it might be different. So we made this in separate javascript file which can be reused in controller.

    The default content is like following.

    nGrinder  3.0
    function getProcessCount(total) {
        if (total < 2) {
            return 1;
        }
        
        return 2;
    }
    
    function getThreadCount(total) {
        if (total < 2) {
            return 1;
        }
        return parseInt(total / 2 + 0.5);
    }

    nGrinder  3.1

    function getProcessCount(total) {
        if (total < 2) {
            return 1;
        }
        if (total > 80) {
            return parseInt(total / 30);
        }
        return 2;
    }
    
    function getThreadCount(total) {
        if (total < 2) {
            return 1;
        }
            if (total > 80) {
            return parseInt(total / (parseInt(total / 30)));
            }
        return parseInt(total / 2 + 0.5);
    }
    nGrinder 3.1.1

    function getProcessCount(total) {
        if (total < 2) {
            return 1;
        }
        
        var processCount = 2;
    
        if (total > 80) {
            processCount = parseInt(total / 40) + 1;
        }
        
        if (processCount > 20) {
            processCount = 20;
        }
        return processCount;
    }
    
    function getThreadCount(total) {
        var processCount = getProcessCount(total);
        return parseInt(total / processCount);
    }


    You can freely rewrite this methods to fit your needs. 

  • grinder.properties – This file defines the default grinder actions. You can configure grinder behavior with this file. Some are overloaded by nGrinder runtime but some are not. In most cases, admin doesn't need to change this file.
    Please refer http://grinder.sourceforge.net/g3/properties.html for detail.
  • plugins folder – In this folder, you can locate nGrinder plugin. Just drop the plugin into this folder. If you want to check the available plugin, refer nGrinder Plugins
  • download folder – You can locate nGrinder agent file in this folder. nGrinder agent will be shown in the agent management screen. This enables the easy agent distribution.

Data Structure

In ${NGRINDER_HOME}, there are some folders to store data used in nGrinder. Followings are description for them.

Folder name Description
logs This store the nGrinder logs. nGrinder intercepts the tomcat log and save the log in ngrinder.log file. This log contains only controller related logs. You can monitor the content of this file through the admin menu.
perftest This folder stores the each performance test related data.
  • perftest/{testid}/dist : contains the files to be distributed.
  • perftest/{testid}/logs : contains the logs from agents.
  • perftest/{testid}/report : contains the statistics for the test.
repos This folder stores the script svn structures. The subfolder of this folder belongs to the each user.
script This folder stores the script validation related resources. The subfolder of this folder is used for user script validation.
db This folder store the H2 database data.
comments powered by Disqus
문서 정보
viewed 1848 times
번역 en
작성자
posted 7달 전
junoyoon
공헌자
마지막 수정시간 5달 전
변경 내역 보기
tagged
Share this article