So currently we are doing the following:
Originally this files were suppose to consist of hundreds hardly a thousand row, but in the end we have files with 15000 rows and the average is about 4000. Incredibly the view (even with 15000 rows and js) works well. But the site becomes quite unresponsive (especially because there are normally a dozen or so users doing the same thing simultaneously).
We have already done as many optimizations as we know (use migrate=False for db, call session.forget in ajax controller functions, byte compile the code) but it still is way too slow. So we are making some heavy changes. I want to try to use the scheduler and workers to do this job, but I fear it will generate even more db queries and make things worse. So I would like some suggestions on how to tackle this problem??
Is scheduler the way to go? An if so should I make a task for every xml and webservice call (this seems like a bad idea to me). Or should I group them in chunks of an arbitrary size (e.g. 50)? And if I make this change will I be able to display the progress of the process?
Thanks for all the help. Good day.
I don't know what else to mention but, if I missed anything please ask. And thanks again.
Hello LightDot
Thanks for the interest in my post, hope we can come up with a way to improve performance. This is my current setup:
- Host: Digital Ocean (and yes I do think their Droplets (as instances are called) are KVM)
- OS: Ubuntu 13.04
- Web Server: Apache 2.2
- Database: PostgreSQL 9.1
- Memory usage in peak times is about 1.4GB (out of 2GB)
- By the way I have no swap partition
- I don't know how to count db connections, but in my db definition I used the poolsize=50, but again I don't know how to check the amount of connections at any given time
- Disk usage acording to Digital Ocean metrics is medium never high (do truly I have never understand their graph)
- CPU usage at some points gets close to 50% (since this a dual core I would assume one of the cores is at 100%)
I don't know what else to mention but, if I missed anything please ask. And thanks again.