# Resource Related

+ `Grafana` Monitor TiDB —> Server —> CPU Usage


![left](./student-guide/diagram/09-TiDB-resources-01-01.png)
------------------------------------------------------------
- Server - CPU Usage: Pay attention to whether the CPU usage of each TiDB is balanced and whether the average/peak usage is within a reasonable range. When the CPU load is high, the cluster performance is abnormal, it is best to grab the CPU profile of the site to help diagnose the cause

- Server - Memory Usage: There are often large SQL or big transaction in some tasks such as derivatives, swaps, running batches, and statistics, which may cause TiDB memory to rise rapidly for a short period of time. You need to pay attention to memory changes to avoid OOM. You can configure relevant parameters to control memory usage, refer to TiDB memory control documentation

- Server - Connection Count: The number of connections in TiDB. By default, TiDB does not limit the number of client connections to max-server-connections. Pay attention to whether the number of connections in each TiDB is balanced. If the cluster load abnormal response becomes slow, you need to pay attention to whether the application creates a large number of new connections causing a connection storm

- Server - Get Token Duration: TiDB will get the token before processing the SQL request. The number of tokens in each TiDB is controlled by the token-limit parameter. If the current active session connection exceeds the token-limit, the request will block and wait for it to be completed to release the token
