Jump to content

External database issues/help


Recommended Posts

Hi,

Today I tried to separate the database and webserver. I thought it would be an easy thing, but...

The first issue was I had to enable a persistent connection to the DB. Otherwise, the web server was returning ~60%  502 errors because "unix:/run/php/php8.0-revive.sock failed (11: Resource temporarily unavailable)".

Now I have a separate nginx + PHP and MySQL. It works, but the DB server has very high IO wait time because of the hard drive and in the peak hours, web server returns 502. When I had it all in one server, the disk writes were less than 1MB/s. Now the database server alone has 25MB/s. Is there any chance that must be done in order to make it work with external database? I'm using the filecache (not Memcached). 

What I did is simple:

  1. Set up two new servers with private IPs.
  2. One is a nginx with PHP and I copied the PHP files there.
  3. Second one is database, where I run MySQL and I imported the old DB there.
  4. I changed the DB connection details to the new one in the config file and I enabled the persistent connection.
  5. I get the high disk writes as a result.

They are connected on a private network with about 0.02ms latency, so there should be no issue. 

Edited by TonyNZ
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...