Category : resources

When one inspects a docker container, they’ll find the following fields, regarding CPU Limits: >docker inspect my_container | grep Cpu "CpuShares": 0, "NanoCpus": 4000000000, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "CpuCount": 0, "CpuPercent": 0, 1 – I am wondering what exactly is the difference between CpuCount and NanoCpus? Which ..

Read more

I have been researching over on how to provide Python subprocess it’s own time and memory. import resource import subprocess def set_memory_time(seconds): limit_virtual_memory(seconds) usage_start = resource.getrusage(resource.RUSAGE_CHILDREN) print("usage_start ", usage_start) try: p = subprocess.check_output( [‘docker exec -it cpp_compiler sh -c "g++ -o Test1 prog1.cpp && ./Test1 < input.txt"’], shell=True) except Exception as e: print(e) usage_end = ..

Read more

In my SpringBoot application I have to read a Json file at this path src/main/resources/mock/fileName.json. I done it in this way JsonReader jsonReaderStream = new JsonReader(new InputStreamReader(Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResourceAsStream("./mock/fileName.json")))); It works locally but when I deploy my docker file on Kubernetes and I try to read my Json file I received a FileNotFoundException. I use gradle for ..

Read more