The usual design of a database-backed website uses few (or much more, like 50 or 100) database queries in order to generate a single web page in response to a browser request.
Every one of these queries, one after another requires a round trip time between the web server and the database server. This can quickly add up.
In contrast, the connection between the web browser and the website is established after two times the round trip between the browser and the server and then the data is pretty much pipelined to the browser as fast as the connection allows.
See the difference? 2 user-server round trips vs multiple (likely tens) of server-server round trips. The connection between the servers may be faster, but not to a great extent.
This is why your setup is generally pointless.
What can be done, then?
- Use a single web server near the database. The times when having geographically distributed servers was important in order to improve the user experience are long gone for anything less than a global e-commerce or news hub.
The user experience today is dominated by the user's connection properties in the first place and barely dependent on the web server location.
Yes, there are times when a major global backbone connection is down and the connections between e.g. China an Europe become a real pain, but if such unfortunate event happens, the connection between your web server and your db server will be equally affected. And this is actually worse than slowing down the connection between your web server and your users, see above.
There are CDN tricks that may improve your response times even with a single server by looking like you have multiple servers at different locations. Major CDN providers like Cloudflare or Akamai have really powerful tools.
Use database replication and maintain a database near both web servers. This may require deep rethinking of the application design, as well as much wider skill set and/or more expensive DB licenses.
Check your database connection properties at both ends (db server and web server).
- Extensive logging, complex authentication and reverse dns on the db server side can pretty much lag the results of each db query.
- Using persistent db connections on the web server side can reduce the db query round trip 2-5 fold.
- Redesign your application to use fewer db queries per page. This, on the other hand, may result in the queries becoming more complex, slower and harder to maintain. Your mileage may vary.