stephenh / mirror

A tool for real-time, two-way sync for remote (e.g. desktop/laptop) development
Apache License 2.0
391 stars 37 forks source link

Issue with bulk file uploads #62

Closed rameshar16 closed 3 years ago

rameshar16 commented 4 years ago

Hi @stephenh, We are placing the bulk files (Around 13k files) on both server and client. Both the server and client getting stuck after syncing the few files.

Have you ever faced this kind of issue? Do we need to add more RAM to the mirror and client if we added the large amount files at a time?

Please help me on fixing the issue?

Thanks and Regards, Ramesh AR

stephenh commented 4 years ago

Yeah, I've seen some stuttering on like an initial sync. I don't go through this scenario often enough to have really observed what is happening/bother too much with fixing it. It sounds like you're using mirror outside of it's intended "just syncing some source code" use-case. Which it will probably work for, but rough edges are likely.

More memory is a good idea. Mirror does have to read every file you're sending into the JVM's memory, but it's supposed to only do that ~a-few-at-a-time as it drains a queue of "here are the things we need to send to the remote". I.e. it should not be "let's read all 13k files into memory at once". If you have evidence of it doing that, i.e. a heap snapshot, let me know.

You might see some output that looks like:

      log.info("Queues: incomingQueue=" + incomingQueue + ", saveToLocal=" + saveToLocal + ", saveToRemote=" + saveToRemote);

You could past that here if you see it.

Realistically I won't be able to help much unless you can get like JVM heap snapshots of something that looks like a memory leak. Or an initial diagnosis of "mirror is making its saveToRemove too full in situation X and we should solve it by catching the queuing approach to Y". I.e. you'll have to be comfortable digging into the Mirror source and doing a bit of investigation on your own.