After some reading and help from #postgresql. I settled on these changes to my memory settings in postgresql.conf. This is on a box with 8gb of ram and 2 cpus.
shared_buffers = 1GB
work_mem = 128MB
maintenance_work_mem = 256MB
effective_cache_size = 6GB
For kernel settings, I did this:
kernel.shmmax=1288490000