Ben Chuanlong Du's Blog

It is never too late to learn.

Check the CPU Limit of a Docker Container

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Get the number in the file /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us. Denote it as cfs_quota_us.

  2. Get the number in the file /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us. Denote …

Hands on the Resource Module in Python

Tips and Traps

This module provides basic mechanisms for measuring and controlling system resources utilized by a process and its subprocesses. It cannot be used to check resource usage of other processes.

Device Managment in PyTorch

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Modules can hold parameters of different types on different devices, so it's not always possible to unambiguously determine the device. The recommended workflow in PyTorch is to create the device object …

Sort top by CPU or Memory Usage

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

By default the result of the top command is sorted by CPU usage on Linux. The table below list options to sort the result of the top command by different criterias …