we have a django & postgresql setup running on ec2. Our application is always writing to the DB in the background - but this is not initiated from user action.
The problem is that when a user does use the system we need to do a great big read, sometimes with full text search, of around 20k items. Any tips on tuning for this scenario??
preguntado el 10 de marzo de 12 a las 00:03
20k items is not that big a read. :)
On EC2, the main things to do are:
- Get as much memory as you can rationally afford; EBS performance is terrible, and you want as much cache as you can manage.
- Make sure your shared_buffers setting is correct; 25% of available RAM is a good starting point.
- Look at the big read with EXPLAIN ANALYZE to look for opportunities to create indexes (but don't just create indexes without a practical reason; they're expensive if they are not being used for anything).
- If changing EBS configuration is an option, consider moving to an 8-stripe soft-RAID configuration.