Thursday, December 11, 2014

Configure Statspack on Amazon Oracle RDS instance




How to Configure Oracle Statspack on Amazon RDS 

  • Add the Statspack option to an option group and then associate that option group with your DB instance. Amazon RDS installs the Statspack scripts on the DB instance and then sets up the PERFSTAT user account, the account you use to run the Statspack scripts.
  • Log in to DB instance using admin user name and password. Execute following command:
ALTER USER perfstat IDENTIFIED BY ACCOUNT UNLOCK;

  • Execute following commands to create Statspack snapshots:
select snap_id, snap_time from stats$snapshot order by 1;

execute statspack.snap(i_snap_level=>7);

exec RDSADMIN.RDS_RUN_SPREPORT(1,5);

  
  • Go to AWS console trace files. The file name of Statspack report that generated includes the number of two snapshots used. For example, a report file created using statspack snapshot 1 and 3 would be Oralce SID_spreport_1_5.lst.

Performance comparison of SynchronizedHashMap and ConcurrentHashMap



Recently we had conducted a test for performance comparison of SynchronizedHashMap and ConcurrentHashMap. While both collections are thread safe implementation of Map interface but our study has shown that ConcurrentHashMap is recommended when asked for better performance.

In SynchronizedHashMap , each method is synchronized using an object level lock so get and put method acquire a lock in SyncMap. Locking the entire collection produce performance overhead. While one thread hold the lock no other thread can use the collection.

On the other side, in ConcurrentHashMap there is no object level locking instead it provides locking at hashmap bucket level. Only write operation is synchronized in case of ConcurrentHashMap.

Performance Comparison: