Body: <p>We have set up a <strong>remote</strong> database connection for Craft CMS so that I and my colleague can work on the same database locally. The connect seems very slow both front end and in the admin area.</p>
  
  <p>Contacting the VPS provider they assure us that the Database is running efficiently. They tested using MySQL Workbench (see results below) and concluded that the slow speed we are experiencing is on connectivity/CMS level. We know this isn't isolated to one ISP as we experience the same thing at home as well as work.</p>
  
  <p>I'm a bit stumped as to what the issue could be. I don't 'think' this is a front end issue but I have also attached a screenshots of the Database Debug for the front end and admin area for entries... just in case this reveals anything... I'm not entirely sure what I'm meant to be looking for. Any help/tips and ideas would be appreciated.</p>
  
  <p><strong>Database Debug (frontend for entry)</strong></p>
  
  <p><a href="https://i.sstatic.net/wZSS2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wZSS2.png" alt="Database Debug (frontend for entry)"></a></p>
  
  <p><strong>Database Debug (admin area for entry editor)</strong></p>
  
  <p><a href="https://i.sstatic.net/PB9w4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PB9w4.png" alt="Database Debug (admin area for entry editor)"></a></p>
  
  <p><strong>Database Workbench Testing</strong></p>
  
  <p><a href="https://i.sstatic.net/IrBku.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IrBku.png" alt="Database Workbench Testing"></a></p>
  
  <p><strong>Slowest Database Queries</strong>
  <a href="https://i.sstatic.net/ZMkkf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZMkkf.png" alt="Slowest Database Queries"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-07T23:47:48.937Z
Comments.Text: Sort the database queries in the debug toolbar by duration descending. What do the slowest queries look like?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-08T09:06:06.757Z
Comments.Text: Thanks Brad - I have added a screenshot to show what it looks like. See anything odd?
Comments.UserDisplayName: Dan Lee
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-09T18:45:16.183Z
Comments.Text: The profiler is showing that it's taking 6.25 seconds for all of the database queries to execute... given the lag of a remote database connection and the fact that it's executing 115+ queries, that doesn't seem surprising to me.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-09T23:59:33.920Z
Comments.Text: So are you saying it is the remote connection?
Comments.UserDisplayName: Dan Lee
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-11T03:20:13.280Z
Comments.Text: Seems reasonable to me.
Comments.UserDisplayName: Brad Bell
Tags: <craft3><database><speed>
Title: Diagnosing Slow Database Connection for Entries (Frontend and Craft Admin)
ThreadText: # Diagnosing Slow Database Connection for Entries (Frontend and Craft Admin)
  
  (Asked by: username_0 on 2019-02-07)
  
  We have set up a **remote** database connection for Craft CMS so that I and my colleague can work on the same database locally. The connect seems very slow both front end and in the admin area.
  
  Contacting the VPS provider they assure us that the Database is running efficiently. They tested using MySQL Workbench (see results below) and concluded that the slow speed we are experiencing is on connectivity/CMS level. We know this isn't isolated to one ISP as we experience the same thing at home as well as work.
  
  I'm a bit stumped as to what the issue could be. I don't 'think' this is a front end issue but I have also attached a screenshots of the Database Debug for the front end and admin area for entries... just in case this reveals anything... I'm not entirely sure what I'm meant to be looking for. Any help/tips and ideas would be appreciated.
  
  **Database Debug (frontend for entry)**
  
  [![Database Debug (frontend for entry)](https://i.sstatic.net/wZSS2.png)](https://i.sstatic.net/wZSS2.png)
  
  **Database Debug (admin area for entry editor)**
  
  [![Database Debug (admin area for entry editor)](https://i.sstatic.net/PB9w4.png)](https://i.sstatic.net/PB9w4.png)
  
  **Database Workbench Testing**
  
  [![Database Workbench Testing](https://i.sstatic.net/IrBku.png)](https://i.sstatic.net/IrBku.png)
  
  **Slowest Database Queries**
  [![Slowest Database Queries](https://i.sstatic.net/ZMkkf.png)](https://i.sstatic.net/ZMkkf.png)
  
  **Tags:** craft3, database, speed
  
  > **Comments:**
  > **username_1**: Sort the database queries in the debug toolbar by duration descending. What do the slowest queries look like?  
  > **username_0**: Thanks username_1 - I have added a screenshot to show what it looks like. See anything odd?  
  > **username_1**: The profiler is showing that it's taking 6.25 seconds for all of the database queries to execute... given the lag of a remote database connection and the fact that it's executing 115+ queries, that doesn't seem surprising to me.  
  > **username_0**: So are you saying it is the remote connection?  
  > **username_1**: Seems reasonable to me.  
  
  ---
  
  ## 0 answers
  
  