This article describes how to check the RabbitMQ container memory usage in a Contrail Service Orchestration (CSO) 5.1.2 on-prem deployment while performing system monitoring.
Perform the following:
Log in to the CSO startup server and run the shell script “ get_vm_details.sh ” from the /root/Contrail_Service_Orchestration_5.1.2 folder.
get_vm_details.sh
/root/Contrail_Service_Orchestration_5.1.2
The script output will give details on the VMs and their corresponding IP addresses.
root@CSO:~/Contrail_Service_Orchestration_5.1.2# ./get_vm_details.sh Load Balancer IP: nginx : 192.168.10.16 keystone : 192.168.10.20 haproxy_confd : 192.168.10.48 etcd : 192.168.10.19 haproxy_confd_sblb : 192.168.10.49 mariadb : 192.168.10.17 nginx_nsd : 192.168.10.18 cso_host : IP_Address : 192.168.10.2/32 k8-infra1 : 192.168.10.26 vrr1 : 192.168.10.29 monitoring1 : 192.168.10.31 k8-master1 : 192.168.10.34 k8-microservices1 : 192.168.10.37 proxy1 : 192.168.10.40 contrail_analytics1 : 192.168.10.44
Log in to the k8-microservices VM. The above output gives the SSH IP address, which has a password-less login.
RabbitMQ is part of infra services, so it will run in the infra namespace.
Run the kubectl get pods -n infra | grep rabbitmq command to check RabbitMQ's pod status.
kubectl get pods -n infra | grep rabbitmq
root@k8-microservices1:~# kubectl get pods -n infra | grep rabb rabbitmq-ha-02/2Running0177d
Execute kubectl exec -it rabbitmq-ha-0 -n infra bash to get into the RabbitMQ container.
kubectl exec -it rabbitmq-ha-0 -n infra bash
root@k8-microservices1:~# kubectl exec -it rabbitmq-ha-0 -n infra bash Defaulting container name to rabbitmq-ha. Use 'kubectl describe pod/rabbitmq-ha-0 -n infra' to see all of the containers in this pod. bash-5.0$
root@k8-microservices1:~# kubectl exec -it rabbitmq-ha-0 -n infra bash
Defaulting container name to rabbitmq-ha. Use 'kubectl describe pod/rabbitmq-ha-0 -n infra' to see all of the containers in this pod. bash-5.0$
After getting into the RabbitMQ container, run the rabbitmq-diagnostics commands. The command to get a memory breakdown is shown below.
rabbitmq-diagnostics
root@k8-microservices1:~# kubectl exec -it rabbitmq-ha-0 -n infra bash Defaulting container name to rabbitmq-ha. Use 'kubectl describe pod/rabbitmq-ha-0 -n infra' to see all of the containers in this pod. bash-5.0$ bash-5.0$ rabbitmq-diagnostics memory_breakdown Reporting memory breakdown on node rabbit@rabbitmq-ha-0.rabbitmq-ha-discovery.infra.svc.cluster.local... allocated_unused: 0.2926 gb (36.37%) binary: 0.2019 gb (25.1%) mgmt_db: 0.0475 gb (5.9%) connection_other: 0.0421 gb (5.23%) plugins: 0.0379 gb (4.71%) queue_procs: 0.0323 gb (4.01%) other_system: 0.0307 gb (3.81%) code: 0.0293 gb (3.64%) connection_channels: 0.0277 gb (3.44%) other_proc: 0.025 gb (3.11%) connection_readers: 0.0123 gb (1.53%) queue_slave_procs: 0.0106 gb (1.32%) other_ets: 0.0045 gb (0.56%) mnesia: 0.0035 gb (0.44%) metrics: 0.0033 gb (0.41%) atom: 0.0015 gb (0.18%) connection_writers: 0.0011 gb (0.13%) msg_index: 0.0009 gb (0.11%) reserved_unallocated: 0.0 gb (0.0%) bash-5.0$
Defaulting container name to rabbitmq-ha. Use 'kubectl describe pod/rabbitmq-ha-0 -n infra' to see all of the containers in this pod. bash-5.0$ bash-5.0$ rabbitmq-diagnostics memory_breakdown Reporting memory breakdown on node rabbit@rabbitmq-ha-0.rabbitmq-ha-discovery.infra.svc.cluster.local... allocated_unused: 0.2926 gb (36.37%) binary: 0.2019 gb (25.1%) mgmt_db: 0.0475 gb (5.9%) connection_other: 0.0421 gb (5.23%) plugins: 0.0379 gb (4.71%) queue_procs: 0.0323 gb (4.01%) other_system: 0.0307 gb (3.81%) code: 0.0293 gb (3.64%) connection_channels: 0.0277 gb (3.44%) other_proc: 0.025 gb (3.11%) connection_readers: 0.0123 gb (1.53%) queue_slave_procs: 0.0106 gb (1.32%) other_ets: 0.0045 gb (0.56%) mnesia: 0.0035 gb (0.44%) metrics: 0.0033 gb (0.41%) atom: 0.0015 gb (0.18%) connection_writers: 0.0011 gb (0.13%) msg_index: 0.0009 gb (0.11%) reserved_unallocated: 0.0 gb (0.0%) bash-5.0$