WWBN / AVideo

Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
https://avideo.tube/AVideo_OpenSource
Other
1.89k stars 972 forks source link

New Mysql server and some errors #7257

Closed gbrn closed 1 year ago

gbrn commented 1 year ago

@DanielnetoDotCom , as per my known case of shared server. I transferred mysql to AWS RDS, using the simplest configuration. For a performance test. The webserver/storage was not transferred:

Version: 8.0.28 Instance class: db.t2.micro vCPU: 1 RAM: 1 GB Multi-AZ: No Storage Type: General Purpose SSD (GP2) Storage: 20 GiB Provisioned IOPS: 0 Automatic Storage Scaling: Disabled

I find that now I still get errors that I saw in the past. But I get fewer errors. Could you tell me if these errors are related to performance or some specific configuration? sqlDAL mysql_dal.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM users_groups as ug WHERE 1=1 ) SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/userGroups.php","line":145,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/CustomizeUser\/CustomizeUser.php","line":56,"function":"getAllUsersGroupsArray","class":"UserGroups","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/Plugin.abstract.php","line":142,"function":"getEmptyDataObject","class":"CustomizeUser","type":"->"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":470,"function":"getDataObject","class":"PluginAbstract","type":"->"}] SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM plugins WHERE uuid = ? LIMIT 1) SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":166,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/Plugin.abstract.php","line":101,"function":"getPluginByUUID","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":470,"function":"getDataObject","class":"PluginAbstract","type":"->"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":185,"function":"getOrCreatePluginByName","class":"Plugin","type":"::"}] SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM plugins WHERE uuid = ? LIMIT 1) SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":166,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":198,"function":"getPluginByUUID","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":87,"function":"loadFromUUID","class":"Plugin","type":"->"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":467,"function":"setUuid","class":"Plugin","type":"->"}] SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM plugins WHERE name = ? LIMIT 1) SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":142,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":460,"function":"getPluginByName","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":185,"function":"getOrCreatePluginByName","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":198,"function":"getPluginByUUID","class":"Plugin","type":"::"}] SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::writeSql] Prepare failed: ()  preparedStatement = "DELETE FROM plugins  WHERE name = ?" formats = "s" SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":100,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":452,"function":"writeSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":183,"function":"deleteByName","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":198,"function":"getPluginByUUID","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":363,"function":"loadFromUUID","class":"Plugin","type":"->"}] SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM  plugins WHERE status='active' AND uuid = '26570956-dc62-46e3-ace9-86c6e8f9c81b' ;) SCRIPT_NAME: /view/videosList.php

 [13-Oct-2022 16:42:27 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":414,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/AVideoPlugin.php","line":554,"function":"getEnabled","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/AVideoPlugin.php","line":320,"function":"isEnabled","class":"AVideoPlugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":83,"function":"loadPluginIfEnabled","class":"AVideoPlugin","type":"::"}] SCRIPT_NAME: /view/videosList.php
DanielnetoDotCom commented 1 year ago

you need to share more from your log.

but I am pretty sure the issue is regarding your resources that are too limited.

the MySQL error seems to be a MySQL disconnection

all the hardware you described is too low for any type of AVideo site

https://github.com/WWBN/AVideo/wiki/AVideo-Platform-Hardware-Requirements

gbrn commented 1 year ago

Dani, I will improve AWS RDS features and review.

I no longer have important error logs.

gbrn commented 1 year ago

I did a test, increased the stancy and the problem is the same. (Remembering that I'm just changing the database server):

Previous instance class: db.t2.micro - 1 vCPU / 1 GiB RAM Current instance class: db.t3.micro - 2 vCPU / 1 GiB RAM / Rede: 2.085 Mbps

I increased it to 2 processors and the Mysql error problem persists. I continue the test... I am increasing to: db.t4g.micro. Let's see if there is any difference.

gbrn commented 1 year ago

Errors displayed:

[18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM users_groups as ug WHERE 1=1 ) SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/userGroups.php","line":145,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/CustomizeUser\/CustomizeUser.php","line":56,"function":"getAllUsersGroupsArray","class":"UserGroups","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/Plugin.abstract.php","line":142,"function":"getEmptyDataObject","class":"CustomizeUser","type":"->"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":470,"function":"getDataObject","class":"PluginAbstract","type":"->"}] SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM plugins WHERE uuid = ? LIMIT 1) SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":166,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/plugin\/Plugin.abstract.php","line":101,"function":"getPluginByUUID","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":470,"function":"getDataObject","class":"PluginAbstract","type":"->"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":185,"function":"getOrCreatePluginByName","class":"Plugin","type":"::"}] SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM plugins WHERE uuid = ? LIMIT 1) SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":166,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":198,"function":"getPluginByUUID","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":87,"function":"loadFromUUID","class":"Plugin","type":"->"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":467,"function":"setUuid","class":"Plugin","type":"->"}] SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::readSql] (no mysqlnd) Prepare failed: ()  (SELECT * FROM plugins WHERE name = ? LIMIT 1) SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: MySQL ERROR: [{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/mysql_dal.php","line":231,"function":"log_error"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":142,"function":"readSql","class":"sqlDAL","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":460,"function":"getPluginByName","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":185,"function":"getOrCreatePluginByName","class":"Plugin","type":"::"},{"file":"\/home\/storage\/e\/88\/c1\/myMySQLDatabaseo\/public_html\/cnetv\/_beta40\/objects\/plugin.php","line":198,"function":"getPluginByUUID","class":"Plugin","type":"::"}] SCRIPT_NAME: /view/info.php

 [18-Oct-2022 15:59:34 America/Sao_Paulo] AVideoLog::ERROR: [sqlDAL::writeSql] Prepare failed: ()  preparedStatement = "DELETE FROM plugins  WHERE name = ?" formats = "s" SCRIPT_NAME: /view/info.php
DanielnetoDotCom commented 1 year ago

you need at least 4 GB of ram, 1 GB is nothing

https://github.com/WWBN/AVideo/wiki/AVideo-Platform-Hardware-Requirements#how-should-the-ram-be

gbrn commented 1 year ago

Hi Dani, yes I have previously checked the necessary requirements.

But I'm in this issue just changing the database server, which is AWS RDS.

When you mention at least the 4GB would be from the main server, the Web server, correct?

I'm running these tests, because as the errors that are presented refer to MYSQL, I think that by improving the database server the problems can be solved.

I'm avoiding messing with the Web Server, because there is also the storage of video files.

DanielnetoDotCom commented 1 year ago

let's say the requirements, I expect the streamer and the DB on the same server.

they can be in a different server, but try to keep the same minimum requirements on both

gbrn commented 1 year ago

Hi @DanielnetoDotCom , after 5 days of testing, I verified that the problems regarding MYSQL were solved. Using AWS RDS with 2 CPUs, even with 1 GiB RAM. (Remembering that it is only the Database running on this server). I believe that as demand increases this memory will have to be increased. But I can already get a cost/benefit parameter that I can use without problems.

Speaking of PHP files, I still get several "Warning: Slow process detected" alerts. Right now I'm starting a test with Lightsail from AWS, to handle PHP files.

DanielnetoDotCom commented 1 year ago

thanks for letting me know the CPU is the bottleneck for the MySQL

regarding the Warning: Slow process detected", this is just a debug log to help me detect what script slows down things.

the only way to remove it is to increase/upgrade your hardware for a faster hardware

gbrn commented 1 year ago

@DanielnetoDotCom , so I conclude this issue, with the relevant information that the errors were caused due to the performance of the shared server. After 8 days of testing, no additional errors occurred regarding MYSQL ([sqlDAL::readSql] (no mysqlnd) Prepare failed:). So running an AWS RDS with the configuration: db.t3.micro - 2 vCPU / 1 GiB RAM / Network: 2.085 Mbps.