[Info-vax] Large mailboxes
Michael Moroney
moroney at world.std.spaamtrap.com
Tue Dec 1 15:02:51 EST 2020
The discussion of mailboxes and MQ kind of reminded me of an old problem:
Consider an application which produces a fairly large number of small (100-200
byte) messages. The messages are sent via TCP to another system, and this can't
be changed. (which is why something like MQ wasn't used)
We don't want to lose any messages.
In order to do that, the code was changed to write the messages to an indexed
file (1 key, the timestamp). A second process reads records ftom the file,
sends to the remote system and upon acknowledgement, deletes the record.
(if no record, it sleeps and tries again) If the link/remote system was down,
messages would accumulate in the indexed files. Once the link was back, the
second process would empty it.
In other words, an RMS indexed file was just a FIFO. By being a file, records
are not lost. That worked, but despite the file being almost always empty or at
most 1-2 records, the file grew and grew and that part of the system slowed. A
workaround was to create a new version of the file once in a while, and delete
the old one (once known to be empty). A $ CONVERT/RECLAIM on an empty or
nearly empty file would chew on it for a while and would make the file faster
[note this was done only to understand what was going on]. The slowness was
from accumulated RMS cruft from all the deleted records.
So in theory, is it possible to implement a VMS file as a FIFO and work
efficiently? That is one process can write records in order, a second
process can read and delete records in order, without RMS cruft from
accumulating?
More information about the Info-vax
mailing list