> I did already a some optimization optimization :
>
> max_connections = 64
> shared_buffers = 32000
> sort_mem = 64336
> fsync = false
Ouch... 64MB of sort_mem? It'll only take 32 sort operations to exhaust your
memory... actually much less since your 2GB isn't likely to be used
exclusively for sorting.
I would start by pushing sort_mem back to 8192 (you might be able to get
away with 16384, but I wouldn't go any higher). Anything else, we'll need to
know what you're doing, schema, queries, explain analyze, etc.
Greg