Back

Getting Error: PDOException - MySQL server has gone away

  • 0
  • Databases
  • Accounts
  • General
  • Self Hosted
erb_abtis
20 Mar, 2023, 19:54

It's why not >> πŸ€” ? Is it or is it not? πŸ˜…

TL;DR
User is experiencing a PDOException - MySQL server has gone away error. They are discussing infrastructure management, separating the database in production mode, and scalability options using Docker swarm. The user also mentions a RAM shortage issue. Another user suggests running an SQL query to fix the corrupted search text index. The user confirms that the SQL query worked and asks if this indicates a bug in MariaDB. They also ask if there is any other backup procedure for databases. The support thread ends with the user asking if the issue is fixed and why the suggested solution is not sufficient. Solution: The user resolved their issue by running the SQL query `ALTER TABLE
Binyamin
20 Mar, 2023, 19:55

Sorry πŸ˜…πŸ˜… Why you think it's not sufficient?

Binyamin
20 Mar, 2023, 19:55

Is that fixed your problem?

erb_abtis
20 Mar, 2023, 19:56

I just wanted to make sure that there is no other backup procedure for databases πŸ˜‰ .

Binyamin
20 Mar, 2023, 19:58

Ohh I got you So yes it's sufficient, I wrote you just to make sure you indeed backed up the database

erb_abtis
20 Mar, 2023, 20:14
TypeScript
ALTER TABLE _1_executions ENGINE=InnoDB;

it did work πŸŽ‰ Thank you sooo much! πŸ™ <:appwriteheart2:1073243188954935387> But this shows, that there is somewhere a bug, isn't? Is it on the MariaDB side?

Binyamin
20 Mar, 2023, 20:15

I'm not really sure The Search text index somehow get corrupted this is more for the AppWrite Team.

erb_abtis
20 Mar, 2023, 20:16

The problem is, that it really shutsdown the whole appwrite backend.

Binyamin
20 Mar, 2023, 20:17

Yes indeed

Drake
20 Mar, 2023, 20:17

it sounds like you're using the default mariadb container on the same server, right? how much memory does your server have?

erb_abtis
20 Mar, 2023, 20:20

It has 16GB RAM (dedicated Azure VM server). But the RAM is being used by a appwrite function, which uses a deep learning algorithm, which eats a lot of on usage RAM. So RAM shortage can't be ruled out.

Drake
20 Mar, 2023, 20:22

hmmm ya that could be a problem. ideally, in a production system, you would separate mariadb into a dedicated server/cluster.

erb_abtis
20 Mar, 2023, 20:37

So the RAM shortage can lead to a not recoverable data corruption in the MariaDB?

erb_abtis
20 Mar, 2023, 20:43

Do I need to use some Kubernetes infrastructure to implement this?

Binyamin
20 Mar, 2023, 20:43

No

Binyamin
20 Mar, 2023, 20:44

AppWrite is ready for it out-of-the-box

Binyamin
20 Mar, 2023, 20:44

What you need to do is to set your database in a separate server

Binyamin
20 Mar, 2023, 20:45

Then update this values within the .env file

TypeScript
_APP_DB_HOST=mariadb
_APP_DB_PORT=3306
_APP_DB_SCHEMA=appwrite
_APP_DB_USER=user
_APP_DB_PASS=password
_APP_DB_ROOT_PASS=rootsecretpassword
Binyamin
20 Mar, 2023, 20:45

And if you're using vpc you can enter the database local address

Binyamin
20 Mar, 2023, 20:46

And also if you want to get into it AppWrite docker-compose file can be easily scalable using docker swarm (Although most of the scalability option would had to be done manually, but still)

hamed
25 Apr, 2023, 14:30

So it's recommended to separate the database in production mode?

Binyamin
25 Apr, 2023, 14:35

If you have a small to small-medium project then everything inside one docker-compose.yml should be just fine.

But if your application is about the grow, Then I think it is. When you're decentralizing your application parts you make it more sustainable and much more easy to maintain it in the long term.

Of course its good to remember to set a VPC between the databases and the actual Appwrite server.

And, BTW, In decentralizing I'm also referring to the two other databases include with Appwrite; Redis and InfluxDB.

hamed
25 Apr, 2023, 14:44

Oh I see, hmm in a future if i go for appwrite cloud service do I need to do the same (I believe they will offer pretty good storage) !

Binyamin
25 Apr, 2023, 14:46

If you use the cloud then you don't to worry about anything, Just your code and implementation, all the infrastructure is managed by Appwrite team

hamed
25 Apr, 2023, 14:49

Uh-huh that's great, thanks πŸ™‚

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more