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

MySQL timeout with big db #26

Closed
johnroper100 opened this issue Jul 23, 2019 · 6 comments
Closed

MySQL timeout with big db #26

johnroper100 opened this issue Jul 23, 2019 · 6 comments

Comments

@johnroper100
Copy link

I have a big database using flask and MySQL. It has about 1,060,000 items to search and index. I'm trying to update the search index for all the items at once using search.update_index() however, MySQL keeps timing out halfway through. Any ideas on how to fix this?

@honmaple
Copy link
Owner

honmaple commented Jul 23, 2019

You can use update_index(yield_per=1000) for big data, please check output of log

@johnroper100
Copy link
Author

Ok, I'll try that

@johnroper100
Copy link
Author

It didn't work. Here is a picture of my error:
Screenshot from 2019-07-23 19-15-29

@honmaple
Copy link
Owner

This looks like a problem about database connection.

@johnroper100
Copy link
Author

Yes, the site is working fine, and the regular search.update_one_index calls are also working fine, it's just the search.update_index that's not working

@honmaple
Copy link
Owner

honmaple commented Jul 24, 2019

What's your configuration of sqlalchemy, maybe it's a issue about SQLALCHEMY_POOL_RECYCLE or SQLALCHEMY_POOL_TIMEOUT

Similar problem https://stackoverflow.com/questions/42163359/flask-sqlalchemy-2013-lost-connection

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

2 participants