Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

def test_connection(self): try: self.conn.ping() except Exception: self.conn = pymysql.connect(host=MYSQL_HOST, user=MYSQL_USER, port=MYSQL_PORT, password=MYSQL_PWD, database=MYSQL_DB,local_infile=True) self.cursor = self.conn.cursor()[FEATURE]: #1275

Open
1 task done
houzhuangcode opened this issue Mar 15, 2024 · 3 comments

Comments

@houzhuangcode
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

conn.ping mysql so slow

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Anything else?

No response

@codingjaguar
Copy link
Collaborator

Could you please provide more context? In which file did this issue occur?

@houzhuangcode
Copy link
Author

我的场景是,配置了阿里云的mysql,但是在这个文件https://github.com/milvus-io/bootcamp/blob/master/applications/image/reverse_image_search/server/src/mysql_helpers.py 的test_connection()函数中如果长时间未使用服务,比如30分钟之后重新使用服务, self.conn.ping()此语句会对mysql进行重新连接,这个连接时间大概会持续15分钟。

@junjiejiangjjj
Copy link

The test connect interface only reconnects mysql, which should be very fast. Could you check whether the status of the mysql service is normal at that time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants