SoapUI

All

Intro

SoapUI I don’t remember that I wrote about it, it is one of those tools that we must master to do some quick tests. Very easy to install, even better to work on it.

SoapUI

soap.png

I think the biggest tip is RTFM, as Suchakrapani once told, and it is here

Don’t forget the <?> WSDL at the end.

The tests are very data-driven, I think the second biggest suggestions is: read the logs.

If you take more than 5 min to do your tests, probably it’s somehow wrong or you haven’t done it correctly

Huge Pages for Oracle

All

Intro

I think very interestingly that Oracle has a script to calculate the huge pages. It’s basically a printf of a division, with a better

$NUM_PG*$HPG_SZ/1024″ | bc -q`; echo “Recommended setting: vm.hugetlb_po   

echo “Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL” ;;

Huge Pages Script

#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script to compute values for the
# recommended HugePages/HugeTLB configuration
#
# Note: This script does calculation for all shared memory
# segments available when the script is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
# Check for the kernel version
KERN=`uname -r | awk -F. '{ printf("%d.%d\n",$1,$2); }'`
# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk {'print $2'}`
# Start from 1 pages to be on the safe side and guarantee 1 free HugePage
NUM_PG=1
# Cumulative number of pages required to handle the running shared memory segments
for SEG_BYTES in `ipcs -m | awk {'print $5'} | grep "[0-9][0-9]*"`
do
   MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`
   if [ $MIN_PG -gt 0 ]; then
      NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`
   fi
done
# Finish with results
case $KERN in
   '2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;
          echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;
   '2.6' | '3.8' | '3.10' | '4.1' | '4.14' ) echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
    *) echo "Unrecognized kernel version $KERN. Exiting." ;;
esac
# End

 

JMV

For JVM we need to do this same calculation and the division is similar

$NUM_PG*$HPG_SZ/1024″ | bc -q`; echo “Recommended setting: vm.hugetlb_po

 

Very interesting!

 

 

 

Kyrgyzstan

All

Comment

I saw here that someone from Kyrgyzstan, that’s absolutely cool. I remember discussing Kyrgyzstan at IBM in 2008 when I was 17 – so 10y ago ~ almost. The senior software developer that was showing IBM to us had recently traveled there and commented on this country and now someone from there was reading about one of my posts.

 

 

 

BOTO3

All

Intro

When using Python and AWS a good tool to learn is BOTO3.   This will save lots of time easily, especially for SQS – queues.

BOTO3

Installing

To set up, this video is one of the best I found.

To install just use pip install boto3

Don’t forget the credentials configurations

Simple code

From the quick start

s3 = boto3.resource('s3')
# Print out bucket names
for bucket in s3.buckets.all():
    print(bucket.name)

REFs

inline

Suggestion: Around the World Flight

All

As the song once said:

Einmal um die Welt (once around the world)

So planing my around the world trip here, I found this site which talk about the different possibilities to do around the world trips with RTW and the services.

And then they talk about AirTreks that helps planning those trips. And later, after doing my schedule with the places I’d like to go, I found that the price was not cheap but not that expensive, I mean. It was somewhat affordable.

 

Finding which version my jar was compiled

All

Well, a quick hint here.

I was doing some tests with a pre-compiled jar and an older version of java. But I didn’t know which version specifically it was compiled – javaassist.jar

To solve this mistery then:

# jar xf javassist.jar

# cd javassist/

# file Loader.class

Result: Loader.class: compiled Java class data, version 51.0 (Java 1.7)

 

1.7 Therefore, we are all good.

jmap -permstat estimation – pt 1

All

Intro

Reading about some issues with jvm here and I found that recently that jmap is actually an estimation based on <sizes for the different types of data a classloader loads>

jmap

Jmaps is used to verify several memory statistics from the jvm. I mean, it’s quite useful.

This tutorial is very helpful btw

jmap failure

Sometimes this estimation might fail quite a bit as in this case.

sun.jvm.hotspot.tools.PermStat.computeSize:

private long computeSize(InstanceKlass k) {
  long size = 0L;

  // the InstanceKlass object itself
  size += k.getObjectSize();

  // Constant pool
  ConstantPool cp = k.getConstants();
  size += cp.getObjectSize();
  size += objectSize(cp.getCache());
  size += objectSize(cp.getTags());

  // Interfaces
  size += arraySize(k.getLocalInterfaces());
  size += arraySize(k.getTransitiveInterfaces());

  // Inner classes
  size += objectSize(k.getInnerClasses());

  // Fields
  size += objectSize(k.getFields());

  // Methods
  ObjArray methods = k.getMethods();
  int nmethods = (int) methods.getLength();
  if (nmethods != 0L) {
     size += methods.getObjectSize();
     for (int i = 0; i < nmethods; ++i) {
        Method m = (Method) methods.getObjAt(i);
        size += m.getObjectSize();
        size += objectSize(m.getConstMethod());
     }
  }

  // MethodOrdering - an int array that records the original
  // ordering of methods in the class file
  size += arraySize(k.getMethodOrdering());

  return size;
}

I think it worth doing part two about this.

REFs