1

I have a very basic Python script running on a Windows VPS. This script is connecting to a Linux private server. This script is for testing purposes:

import mysql.connector

mydb = mysql.connector.connect(
  host="***",
  user="***",
  password="***",
  database="***",
  connection_timeout=60
)

mycursor = mydb.cursor()
mycursor.close()
mydb.close()

Running this script multiple times takes the following amounts of time:

1 second
1 second
More than 21 seconds
1 second
1 second
1 second
More than 21 seconds

The problem illustrated in this test script is causing my actual script to fail. Please help me diagnose the problem. Any suggestions for the source of the problem (firewall etc.) massively appreciated.

Ned Hulton
  • 477
  • 3
  • 12
  • 27
  • Additional information request from the private server hosting MySQL, please. RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; for server workload tuning analysis to provide suggestions. – Wilson Hauck Dec 28 '21 at 01:37
  • Also, please post last 400 lines from your error log for analysis. – Wilson Hauck Dec 28 '21 at 01:38

0 Answers0