Cloud Database Monitoring using SelectStar – Part VI

We are looking at SelectStar, the heterogeneous monitoring solution for cloud databases. In the previous blog post here, we completed adding an Oracle database from our on-premise collector. The database then appeared in the SelectStar database overview page.

We then started to look at the collector processes at the UNIX level. Let us now examine the memory usage of these processes via the following command:

# ps aux  | awk '{print $1 "\t" $2 "\t" $3 "%\t" $4 "%\t" $5/1024 "\tMB\t"  $6/1024 "\tMB\t" $11}'  | grep '4445\|4710\|4910'
root           4445           0.1%          0.4%          5901.27     MB             51.3477     MB             java
root           4710           0.3%          0.9%          6337.2       MB             116.273     MB             java
root           4910           5.3%          1.9%          3627.83     MB             248.656     MB             java


This runs the “ps aux” command and then prints certain parts or fields of the output using “awk”. The \t puts a tab between each field. The 2
nd field is the process id. The 3rd field is the %CPU, and the 4th field is the %MEM. Note of course, that the total memory allocated to the machine is 13000MB, and 4 virtual CPUs in Virtualbox.

From the man page of ps, the %CPU is the CPU utilization of the process, which is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage. The %MEM is the ratio of the process’s resident set size to the physical memory on the machine, expressed as a percentage.

The 5
th field is the VSZ, which is the virtual memory size of the process in KB. This field is divided by 1024 to give the virtual memory size in MB.

Next, the 6
th field is the RSS, this is the resident set size or the non-swapped physical memory that a task has used (in KB). This field is also divided by 1024 to give the resident size in MB.

The last field in the print list is the 11
th field, this is the first word of the actual command.  The resulting output is then filtered using grep, by searching for the three process ids we had found earlier.

Another way to get this output is as follows, with reverse sorting on the 4th key of the VSZ:

# ps  -p 4445,4710,4910 -o pid,%cpu,%mem,vsz,rss,comm= | sort -rn -k 4
 4710  0.3  0.8 6489288 113404 java
 4445  0.1  0.3 6042904 47080 java
 4910  5.2  1.9 3714896 249352 java
  PID %CPU %MEM    VSZ   RSS


So, we can understand the memory and CPU utilization of the Selectstar collector processes from the output. The utilization seems seems reasonable.


Log back in to the main SelectStar database overview page.  We can see the recently added SaiProd Oracle database. Drill down to further detail, by clicking on the database. The overview page appears for the SaiProd database.




In the overview page, we can see the Alerts in red, and the Recommendations in blue. A graphical display of the last hour’s database wait time, query execution time, and session count is also seen on the overview page. Let us now move to the recommendations tab.


We will examine the recommendations and then the alerts for this database in the next blog post.






Comments

Popular Posts

Disclaimer: Opinions expressed in this blog are entirely the opinions of the writers of this blog, and do not reflect the position of any company. No responsiblity will be taken for any resulting effects if any of the instructions or notes in the blog are followed. It is at the reader's own risk and liability.