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

Is there any way to improve performance #10

Open
ranqiangjun opened this issue Jul 6, 2019 · 2 comments
Open

Is there any way to improve performance #10

ranqiangjun opened this issue Jul 6, 2019 · 2 comments

Comments

@ranqiangjun
Copy link

ranqiangjun commented Jul 6, 2019

I adjusted the script a little bit on my fork. Following is the pseudocode:

Before:

for item in items:
    dump_file()
for item in items:
   update_db()
for item in items:
    remove_blobs()

After:

for item in items:
    dump_file()
    update_db()
    remove_blobs()

the scanned rows would become less and less, I guess it will improve the performance a little

For MongoDB, I am a newbie. As you can see from the screenshot below, about 20s to dump the file, and 20 more seconds to remove blobs. The migration process is pretty slow. So I am wondering if there is a way to improve it, thanks in advance, and thanks for your script!

image

@ranqiangjun ranqiangjun changed the title Is there anyway to improve the performance Is there any way to improve performance Jul 6, 2019
@ranqiangjun
Copy link
Author

btw, creating index saved my day db.rocketchat_uploads.chunks.createIndex( { files_id: 1, n: 1 }, { unique: true } )

@arminfelder
Copy link
Owner

@jungleran , I am quite supprised that rocketchat does not set in an index files_id, I guess should be fixed in RC as well

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