When in doubt about how to tune a PostgreSQL server, try PGTune. This project will read your current postgresql.conf and output a new one with tuning settings designed for the machine it's running on. As an important side note, this will not take into account the necessary memory for the message queue or the web server, so leaving a small amount of extra resources by slightly tuning down these settings can help with performance.
We'll want to begin ...