-
Notifications
You must be signed in to change notification settings - Fork 12
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
Improve fileset distribution during the memo file regeneration #150
Improve fileset distribution during the memo file regeneration #150
Conversation
Similarly to what omero fs importtime does, this uses the difference between the image creation timestamp and the end of the upload job associated with the fileset to estimate the server-side time spent in initializing the reader. The SQL results are sorted in decreasing order of the initialization time
The using of the chunks option with round robin distribution should create as many input files as there will be jobs and ensure the projected regeneration times are as equally distributed as possible
So if I understand this correctly Originally we had concerns over garbage collection with long running If this is the intent to only have large lists for each processor there's very little utility in using parallel at all since we're not managing a list that's larger than available processes. |
Yes that's the current implementation
In the IDR process for regenerating memo cache files which is still using a combination of GNU parallel +
A possible compromise would be to split the CSV using round-robin distribution into Nx$JOBS input files where the default value of N is either a fixed value or auto-computed from the number of rows in the CSV and the value of $JOBS to ensure that the default input files have a maximum number of entries (assuming we use the existing 500 by default). |
ce85355
to
8fb7fb4
Compare
8fb7fb4
to
08b1ad2
Compare
Last commits and especially 7e22384 should address the concerns raised in #150 (comment) around the potential for growing input files. The utility now splits the original CSV into N * jobs files using round robin distribution. N is computed using the value of
|
@chris-allan have you have a chance to have a look at these changes? |
The impact of this change was tested in a development instance with 4 CPUs/ 8GB of RAM with a database including 3797 memo files to regenerate (3686 ok, 1 fail, 110 skipped). The memo regeneration utility was executed 3 times in 3 multi-threaded conditions:
DNF means that that the memo regeneration did not run to completion in any of the three execution as the process ran out of memory after ~12min and was terminated by the OOM killer. In summary, there are 2 conflicting effects:
My assumption is that the latter observation is a consequence of the ordering of the filesets to regenerate in reverse order of initialization time. This means the longest (and possibly the most memory and or I/O intensive) regeneration processes are scheduled to be started concurrently at the onset of the memo regeneration process. |
Good discussion with @stick and @chris-allan regarding #150 (comment). As per
The individual memo regeneration processes are memory constrained up to 2G. For 4 concurrent jobs, this means the total memory that might be allocated by Java is 8GB, which is exactly the total available memory of the system. Considering any overhead and other running processes, the fact that the execution leads to an OOM with Overall, the outstanding next step is probably to compute and expose the maximum amount of memory that would be allocated by the command and review our internal documentation of the different options and the trade-offs |
Fixes #148
This implements the strategy suggested in the issue above to improve both the predictability and the performance of the memo file regeneration.
The SQL query generating the list inputs has been updated with a new column containing the initial reader initialization time per fileset and sort the results using these values in descending order. The initialization times are computed in a very similar fashion tor to
omero fs importtime
by querying and taking the difference between the image creation timestamp and the fileset upload job timestamp. As foromero fs importtime
, these values reflect the server-side reader initialization at import time and are unaware of any change since maybe it be on the software side like Bio-Formats reader performance improvements or on the storage side like moving the data through a tiered storage. Nevertheless, this should be a good initial proxy measure allowing to classify the different filesets imported in OMERO Plus and significantly help distributing the regeneration tasks in a parallel environments.The regen-memo-files.sh script has been updated to divide the SQL results in
chunks
as defined in the split command. The output of the command should be a number of input files equal to the number of parallel jobs to be started viaparallel
. The splitting is made using round robin distribution so that the total initialization time is as homogenously distributed as possible between the input files.Finally a few additional cleanup were added to the
regen-memo-files.sh
script to remove CentOS 6 handling and the--batch-size
option now superseded by the chunk split.In terms of functional testing, the best environment would be an OMERO instance containing a reasonable number imported filesets with heteregenous initialization times i.e. from small individual fake files to large plates. The execution time of
regen-memo-files.sh
should be compared with and without these changes. The outcome of the memo file regeneration itself (successes/failures/skips) should be unchanged. With these changes, the overall execution time should be reduced and the parallel jobs should roughly start and finish at the same time.