agent with -server and -xmx -xms

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

agent with -server and -xmx -xms

junoyoon
Administrator

Dear ngrinder developers..


So far there was no xmx and xms option in process execution. So.. I added the option depending on how many process is used for test test.

And I added -sever option to have more stabled JVM.


Following is the logic I added.


protected StringBuilder addMemorySettings(StringBuilder jvmArguments) {

String processCountStr = properties.getProperty("grinder.processes", "1");

int processCount = NumberUtils.toInt(processCountStr, 1);

long desirableXmx = DEFAULT_XMX_SIZE; // make 500M as default.

try {

// Make a room with 100MB.

long actualFree = new Sigar().getMem().getActualFree() - (100 * 1024 * 1024);

// If memory enough..

desirableXmx = actualFree / processCount;


if (desirableXmx < (DEFAULT_MIN_XMX_SIZE)) {

LOGGER.error("There is very few memory availble {}. It's not enough to run test", actualFree);

desirableXmx = DEFAULT_MIN_XMX_SIZE;

} else if (desirableXmx > DEFAULT_MAX_XMX_SIZE) {

desirableXmx = DEFAULT_MAX_XMX_SIZE;

}

} catch (SigarException e) {

LOGGER.error("Error occurs while calculating memory size", e);

desirableXmx = DEFAULT_XMX_SIZE;

}

return jvmArguments.append(" -Xms" + getMemorySizeStr(desirableXmx / 2) + "M -Xmx"

+ getMemorySizeStr(desirableXmx) + "M ");

}



Following is result.


Conclusion.

 * -xms and -xms, -server option make the process excecution more stabled. Not much fluctuation..

 * TPS goes up 15% more.




TPS Total 95.8



TPS Total 111.2




JunHo Yoon
Global Platform Development Lab
/ Senior Engineer

13th FL., Bundang First Tower, 266-1, Seohyeon-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, 463-824, KOREA
Tel 031-600-9071   Fax --   Mobile 010-6255-0559
Email  [hidden email]

NHN Business & Platform NAVER HANGAME 쥬니어네이버 해피빈 미투데이