Hi there,
I am processing a bunch of JLD2 files (O(10GB)) on my local cluster. Sometimes (not always), loading a file takes ages (>10min), but sometimes it only takes ~10 seconds. Usually after loading it slowly once, the second time loads fast. I don’t think the issue is JLD2 only. Has anyone experienced something similar? Is it related to the hardware infrastructure or am I doing something wrong?
df -T says the filesystem is gpfs. I didn’t find anything here or on google that describes such a behaviour.
The document said: To exploit disk parallelism when reading a large file from a single-threaded application, whenever it can recognize a pattern, GPFS intelligently prefetches data into its buffer pool, ...
Maybe the reason is sometimes data are buffered while sometimes not?
This definitely sounds like the behaviour of buffers.
However if you are using a heirarchical storage management system it could eb old files are being pulled back from a slow tier - maybe tape.
Tme to bring cookies to the lair of your system admins.
I really don’t think that tapes are involved here. These are not some old data files produced months/years ago (in fact the cluster didn’t exist a year ago). But maybe 50-100 MB/s hard drives are indeed close to the read speed.
Thanks for this check. It seems like the infrastructure is not the issue:
21115272060
real 0m28.891s
user 0m0.075s
sys 0m14.022s
18912694826
real 0m24.032s
user 0m0.048s
sys 0m12.997s
18828809688
real 0m23.701s
user 0m0.052s
sys 0m12.657s
20063077414
real 0m28.950s
user 0m0.069s
sys 0m12.961s
19977486641
real 0m27.586s
user 0m0.063s
sys 0m13.536s
20651053712
real 0m27.257s
user 0m0.072s
sys 0m13.589s
So can it be that the data structure is the caveat? Is having a bunch (<10) of dataframes stored in a namedtuple a bad idea?
I am not sure. Long tuples are generally discouraged, but <10 is not long. Do all the named tuples share the field names? I could see it be a problem if the field names change (calling a function with a tuple with differently named fields triggers compilation each time), but my understanding is only superficial.
It’s just one namedtuple per file, and in each file the namedtuple has the same field names. Here’s an example of the namedtuple that is saved in one .jld2 file:
That looks related, but I updated to the latest JLD2 version and the issue remains. When I load a file that has not been loaded before, it takes ages. Is the filesystem check with cat really comparable here? If I use two different julia sessions in one job (i.e. in one environment on one node), after loading the file once, the other session also loads the file fast the first time. If I start another slurm job on another node, the first load of that same file is slow. It seems like it really has to do with the distributed file system, but somehow cat does not capture this?
Hmm no that does not seem to be the case. cat gives the same timing from anywhere, on files that have not been accessed before. I can cat a file in 20seconds, but if JLD2 hasn’t loaded it before, JLD2 takes >400 seconds to load it. The second time (even if restarting the julia session), JLD2 loads it in 20 seconds.
when you say “local” do you mean something literally on your laptop (hosted on a docker k8s instance or swarm) or do you mean the one you use in your network?
if the latter - have you asked your admins if there is any auto shutdown/restart or shared services / queues /activities taking place?
“local” means a university HPC cluster that is not something like azure, aws etc. It’s SLURM managed and it’s about a few hundred nodes with lots of storage (kTB). I have not asked the admins about data-access issues as of now. I’m just at the stage of trying to narrow down what is happening.
I’ve had similar experience in the past, just sharing here. I didn’t have the chance to debug it in detail since it is a random issue, and I don’t have the computer science background to inspect file systems.
I think you should try to figure out if this is related to JLD2 or not. The easy way to do this is to save a copy of the data in another format and repeat your reading experiments.