Skip to content

Event buffers: configuring

This page covers how to size event buffers.

For the concepts and day-to-day use, see Event buffers: overview.

Event and buffer sizes

The default maximum event size is 4MB, and the default buffer size is 32MB.

For some experiments, these may not be large enough. When changing these limits, you should ensure that a buffer is at least twice the size of the maximum event size, and ideally large enough to hold 10-100 events. This is so that the buffers can successfully decouple the production and consumption of events.

In practice, buffer sizes are limited by the amount of RAM in your system, and event sizes are limited by the size of your buffers.

Full list of limits on event and buffer sizes
  1. BANK32 and BANK32A are limited to a ~4.2GB (2^32 bytes); BANK is limited to ~65kB (2^16 bytes).
  2. Bank size is limited by event size
  3. Event size in a frontend is limited to the value of max_event_size set by the user
  4. The maximum event size that can go through the midas event buffer system is limited to ODB value /Experiment/MAX_EVENT_SIZE
  5. The maximum event size is limited to half the size of the SYSTEM shared memory event buffer (or any other buffers that the event has to go through)
  6. The default size of the SYSTEM buffer is 32 MiB set by ODB /Experiment/Buffer sizes/SYSTEM. This limits maximum event size to about 16 MiB.
  7. The size of an event buffer can be increased up to 2097152000 bytes (about 2 GB). In practice it should be no bigger than the amount of computer physical memory minus space needed for running the frontend program and mlogger, which also allocate buffer space to hold 1 event of maximum size.

e.g. For a computer with 8GB of RAM, you could set the SYSTEM buffer size to 2GB, the maximum event size to 1GB, and in theory you would be able to write 1GB events from a frontend to disk.

Increasing maximum event size

To increase the size of events, you must increase both:

  • the value of ODB key /Experiment/MAX_EVENT_SIZE
  • max_event_size in the frontend code

Increasing buffer sizes

To increase the size of the SYSTEM buffer:

  • shutdown all clients
  • set ODB key /Experiment/Buffer Sizes/SYSTEM to the larger value
  • remove SYSTEM shared memory file .SYSTEM.SHM
  • restart clients

The same procedure applies to other buffers.