You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Removing large zarr stores recursively blows up memory #690
Do the files in the paths that execute before crash successfully disappear?
I think some of the chunks were successfully deleted if I remember correctly. I just tried it again with a larger RAM server and I was able to delete the smaller of two zarr stores similiarly large stores successfully, but the memory usage was quite high still (went up about 2+GB, and for the larger one it blew the memory out again).
Is the memory footpring supposed to scale with the size of the deleted folder?
Do you have any suggestions for further debugging? Many thanks.
@isidentical , do you think it might help to replace the explicit asyncio.gather in GCSFileSystem._rm with the throttled version?
@jbusecke , it is hard to tell where the memory runs out - it would be useful to know whether it is during the listing of the files or when issuing the delete calls. If some files were indeed deleted, this suggests the latter, in which case my suggestion in the line above might help. Also, you might try increasing the batchsize argument to rm, which makes for fewer, larger calls (and I think it's the number of calls which will pose the problem).
Another improvement we could make, if to add an on_error argument, as is done for some other batch methods, so that we can avoid return_exceptions=True in gather, which might present a memory saving for failed calls.
@jbusecke , the throttled gather is fsspec.asyn._run_coros_in_chunks, where you would specify a chunksize. Would you like to try to implement this, see if it helps?
@isidentical , it occurs to me that it might be nice if that function accepted a generator for coros, not just a list, so that they don't all need to be instantiated ahead of time.
Activity
martindurant commentedon Jul 2, 2021
This seems like a very reasonable thing to do. Please post your versions. Do the files in the paths that execute before crash successfully disappear?
jbusecke commentedon Aug 24, 2021
Hi @martindurant, sorry for the radio silence. I was on vacation and stuff got a bit hectic before leaving.
So this occurs with version '2021.04.0' of fsspec, what other package versions would be helpful for you to know?
Here is the output of
xr.show_versions()just in case:I think some of the chunks were successfully deleted if I remember correctly. I just tried it again with a larger RAM server and I was able to delete the smaller of two zarr stores similiarly large stores successfully, but the memory usage was quite high still (went up about 2+GB, and for the larger one it blew the memory out again).
Is the memory footpring supposed to scale with the size of the deleted folder?
Do you have any suggestions for further debugging? Many thanks.
martindurant commentedon Aug 25, 2021
@isidentical , do you think it might help to replace the explicit
asyncio.gatherinGCSFileSystem._rmwith the throttled version?@jbusecke , it is hard to tell where the memory runs out - it would be useful to know whether it is during the listing of the files or when issuing the delete calls. If some files were indeed deleted, this suggests the latter, in which case my suggestion in the line above might help. Also, you might try increasing the
batchsizeargument torm, which makes for fewer, larger calls (and I think it's the number of calls which will pose the problem).Another improvement we could make, if to add an
on_errorargument, as is done for some other batch methods, so that we can avoidreturn_exceptions=Trueingather, which might present a memory saving for failed calls.isidentical commentedon Aug 25, 2021
If the memory consuption is scaled with the number of calls to
_rm_files, then yes it might work.martindurant commentedon Aug 25, 2021
@jbusecke , the throttled gather is
fsspec.asyn._run_coros_in_chunks, where you would specify achunksize. Would you like to try to implement this, see if it helps?@isidentical , it occurs to me that it might be nice if that function accepted a generator for
coros, not just a list, so that they don't all need to be instantiated ahead of time.