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
Needs to work for HRPD-X/SANDALS2/WISH/VESUVIO etc before MNeuData is available. We do not need to solve the MNeuData case in this issue, but we should pick an architecture which makes it possible to extend in likely MNeuData directions later.
An architecture that takes configuration values in either a config file or set of environment variables, with a preference for the latter, would be ideal for deploying en-mass in a typical operator pattern, allowing trivial horizontal scaling based on usage.
One thing to discuss is the requirement for a message queue, and likely how/where that will be hosted (can be inside the MNeuData compute cluster). I foresee a requirement for the message queue, due to the likely desire to queue up requests/provide a pool of compute for filewriters, instead of having 1 filewriter waiting for each instrument and needing a heck of a lot of more hardware, a generic filewriter that can handle any instrument as needed makes the most sense to me.
Another technical caveat will be ensuring that this is not a windows only, un-containerisable piece of software, whilst ensuring that the software should be able to redo a job if it is interrupted part way through (hence the message queue), that will get picked up by another in the queue if the filewriter disappears for some reason.
One thing to discuss is the requirement for a message queue
If we choose a pooled architecture, then I think the ESS schemas & kafka topics for FW control would be the starting point for this discussion. Doesn't mean we can't diverge if we deem it necessary.
Another technical caveat will be ensuring that this is not a windows only, un-containerisable piece of software
It will run on Linux (likely in a container) for HRPDX/SANDALS/WISH/VESUVIO etc. As it just has Kafka as input and filesystem as output, I see no special reason why it would be particularly difficult to containerise.
Pooled architecture is a requirement if we might ever collect data faster than it can be written to disk. This seems unlikely at present.
I assume you mean faster than an individual file writer may be able to write a NeXus files from the broker events as opposed to faster than the kafka broker can write to disk?
I assume you mean faster than an individual file writer may be able to write a NeXus files from the broker events as opposed to faster than the kafka broker can write to disk?
Yes. The Kafka broker side scales at frame-level granularity by splitting the messages for different frames between different Kafka partitions. event-aggregator already sets a per-frame key to do this.
However, a pooled filewriter could only scale by splitting .nxs-writing jobs between servers at file-level granularity, not frame-level. A per-instrument architecture would obviously not scale horizontally at all.
The fundamental limits, assuming we're writing events, would most likely be one of:
Input network rate from kafka cluster to a single file-writing server (likely 10gbit)
SSD write rate (~6gbit for single SATA SSD, NVMe somewhere in the ballpark of 40gbit)
Output network rate to downstream archive storage (likely 10gbit)
Total write rate to downstream archive storage (with current archive on spinning disks, this is most likely the practical limiting factor)
If we had a filewriter-per-instrument architecture then exceeding those limits means file-writing tasks start backing up and will eventually fail.
With a pooled architecture:
Limits (1) and (2) become irrelevant as the .nxs writing job for two nxs files can be on two different servers, potentially overlapping in time.
Limit (3) would still be relevant assuming all .nxs-writing servers ultimately share the same network uplink to the downstream archive servers.
Limit (4) remains relevant, but may become irrelevant if we change archive architecture, as it may then be able to scale better on the archive side.
Activity
Tom-Willemsen commentedon Jul 27, 2026
@Pasarus your input is welcome, especially r.e. making this extensible towards likely MNeuData approaches.
Pasarus commentedon Jul 27, 2026
An architecture that takes configuration values in either a config file or set of environment variables, with a preference for the latter, would be ideal for deploying en-mass in a typical operator pattern, allowing trivial horizontal scaling based on usage.
One thing to discuss is the requirement for a message queue, and likely how/where that will be hosted (can be inside the MNeuData compute cluster). I foresee a requirement for the message queue, due to the likely desire to queue up requests/provide a pool of compute for filewriters, instead of having 1 filewriter waiting for each instrument and needing a heck of a lot of more hardware, a generic filewriter that can handle any instrument as needed makes the most sense to me.
Another technical caveat will be ensuring that this is not a windows only, un-containerisable piece of software, whilst ensuring that the software should be able to redo a job if it is interrupted part way through (hence the message queue), that will get picked up by another in the queue if the filewriter disappears for some reason.
Tom-Willemsen commentedon Jul 27, 2026
If we choose a pooled architecture, then I think the ESS schemas & kafka topics for FW control would be the starting point for this discussion. Doesn't mean we can't diverge if we deem it necessary.
It will run on Linux (likely in a container) for HRPDX/SANDALS/WISH/VESUVIO etc. As it just has Kafka as input and filesystem as output, I see no special reason why it would be particularly difficult to containerise.
FreddieAkeroyd commentedon Aug 9, 2026
I assume you mean faster than an individual file writer may be able to write a NeXus files from the broker events as opposed to faster than the kafka broker can write to disk?
Tom-Willemsen commentedon Aug 10, 2026
Yes. The Kafka broker side scales at frame-level granularity by splitting the messages for different frames between different Kafka partitions.
event-aggregatoralready sets a per-frame key to do this.However, a pooled filewriter could only scale by splitting
.nxs-writing jobs between servers at file-level granularity, not frame-level. A per-instrument architecture would obviously not scale horizontally at all.The fundamental limits, assuming we're writing events, would most likely be one of:
If we had a filewriter-per-instrument architecture then exceeding those limits means file-writing tasks start backing up and will eventually fail.
With a pooled architecture:
.nxswriting job for twonxsfiles can be on two different servers, potentially overlapping in time..nxs-writing servers ultimately share the same network uplink to the downstream archive servers.