Developing a web application (Django, python 3, PostgreSQL). Due to certain requirements for the application, it is necessary for the database to be on another server.
The difference in query execution time (the same page):
- 34.67 ms (29 requests) - DB and Django on the same server
- 2093.07 ms (30 requests) - DB and Django on different servers
Django-debug-toolbar SQL data
Question: Is there a way to increase the speed of data transfer?
Obviously, the main problem is the remote connection. PostgreSQL 9.3, Ubuntu 14.04 (on both servers). PostgreSQL settings are currently standard, remote connection is allowed by login password.