lundi 30 novembre 2020

OpenSSL speed test : pour comparer la vitesse des differentes algorithmes des-cbc des-ede3 aes-128-cbc aes-256-cbc

La commande openssl:  openssl speed -elapsed des-cbc des-ede3 aes-128-cbc aes-256-cbc
nous montre combien de données chaque algorithme peut traiter en 3secondes, plus nous avons blocs plus l'algorithme est rapide :
Pour conclure AES-128  est le plus rapide car il traite plus de données que les autres algorithmes  (voir  le resumé en bas de la capture d'ecran):



jeudi 5 novembre 2020

How to set memory limit for your Java containers?


In earlier versions of Java 8 (before update version 192), the JVM has no knowledgeof any limits that the container will enforce: when it inspects the environment to find out how much memory is available so it can calculate its default heap size, it will see all the memory on the machine (instead of,as we would prefer, the amount of memory the Docker container is allowed touse)

The real issue here is the memory: the maximum size of the heap will potentially be larger than the memory assigned to the Docker container.

When the heap grows to that size, the Docker container (and hence the JVM) will be killed.

As java 11 (10+) can automatically detect the container's memory you can set memory limit on your container and it should WAI:
docker run -m 512 .... 

 https://www.upnxtblog.com/index.php/2019/03/14/how-to-set-memory-limit-for-your-java-containers/ 

https://stackoverflow.com/questions/64703776/how-to-set-memory-limit-for-java-11-inside-docker/64705449#64705449

https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits

-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap : permet de ne limiter la taille de la JVM qu'à ce que peux supporter le conteneur. 

-XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics : log des informations sur l'occupation des espaces mémoires propres à la JVM.