There is a django "web application" (from hell) we are hosting on a dedicated server. After some benchmarking I found that the "Application" is amazingly bad at database operations (refactoring is not an option at this time). It generates an ungodly amount of read and write activity. Right now we are getting another (second one) dedicated server for the sake of increased performance and a bit of emergency redundancy. Both machines sport 24cores (Intel(R) Xeon(R) CPU E5645 @ 2.40GHz) and 48GB of RAM (also, there is Raid 10, 6x150gb 15k hardrives).
I was wondering how can we improve the setup.
- Use KVM for virtualization, do separate vmachines for nginx+uwsgi, memcached and postgresql. Preferably make more than 1 postgresql - and use pg-pool to get more out of it.
- Leave the virtualization alone, install everything on each server, then with this mirror setup get proper load balancer at the datacenter level.
- Get a couple more machines - fewer cores, less ram (cheaper in general than the other two "main ones") and set some db cluster there?
- IF db cluster route - then what would give the best performance for writes and reads?
(we are rewriting the application proper way in the meantime, but getting the current - crappy - one running a bit faster is vital, we need it to hold with increasing traffic for at least the next 3 months...)
Can you offer some advice regarding strengthening the setup a bit? With the emphasize on preparing database machine structure for the ridiculously inefficient app-from-hell.