Both of these have the function of limiting process resources, but rlimit is two system calls, which seems to be more low-level. Does the implementation of cgroup use rlimit? Or is there no relationship between the two and they are two independent mechanisms?
cgroup is a resource that limits a group of processes, and rlimit is a resource that limits a process or a user. They are two independent mechanisms, which are irrelevant. There seems to be almost no overlap in what they restrict. A process is subject to cgroup Restrictions are also subject to rlimt restrictions. You can refer to: Cgroup overview and man getrlimit