Postmaster uses excessive CPU and Disk Writes
Your PostgreSQL configuration is way off. This was suspicious from your initial post,
Cpu(s): 18.9%us, 14.4%sy, 0.0%ni, 53.4%id, 11.8%wa, 0.0%hi, 1.5%si, 0.0%st
Mem: 32865916k total, 7263720k used, 25602196k free, 575608k buffers
Swap: 16777208k total, 0k used, 16777208k free, 4464212k cached
Out of 32GB on your server, ~25GB is free excluding ~575MB of buffer.
From your postgresql.conf file,
shared_buffers = 32MB # min 128kB
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
...
#work_mem = 1MB # min 64kB
#maintenance_work_mem = 16MB # min 1MB
#max_stack_depth = 2MB
I'm assuming this is a dedicated database. If so, change it to the following parameters and reload/restart,
shared_buffers = 16GB # min 128kB
temp_buffers = 128MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
...
work_mem = 8MB # min 64kB
maintenance_work_mem = 64MB # min 1MB
max_stack_depth = 4MB
Do let me know how this changes your performance and can further tune it as needed.
Regards to unlogged tables, if your temporary tables contain temporary data that is ephemeral and, as you mentioned, are created on session, it's better to use unlogged tables.
You can truncate your tables post session if that is acceptable.
More info here -- http://michael.otacoo.com/postgresql-2/unlogged-table-performance-in-postgresql-9-1/
I'm unsure of why you need temp tables for replication. Can't you use PostgreSQL streaming replication?