> shared_buffers = 128 # min max_connections*2 or 16, 8KB each
Try 1500.
> sort_mem = 65535 # min 64, size in KB
I'd pull this in. You only have 640MB ram, which means about 8 large
sorts to swap.
How about 16000?
> fsync = false
I presume you understand the risks involved with this setting and
dataloss.