Use sp_configure to ensure that the number of locks in RAPCache is greater than the number of locks required by the RAPCache subscriber or other applications that may query the data.
sp_configure 'number of locks', 200000You may also need to adjust the sp_configure parameter max memory, since each lock uses memory.
At a minimum, the number of locks needs to be greater than the number of locks required by the RAPCache subscriber. RAPCache may also need locks for other applications which may be querying the data. The RAPCache subscriber requires locks when inserting data into the RAPCache. The number of required locks is affected by the bulk batch size parameter in the rapcache.xml configuration file. This parameter tells the RAPCache subscriber how many rows to include in a bulk insert before committing the transaction.
The bulk batch size parameter is a value that is used per message type, so if the bulk batch size is 10,000 and the RAPCache subscriber handles 20 message types; the number of locks required is 200,000. In addition, if the table is partitioned, then the number of locks required for this program only is (number of partitions) * (bulk batch size).
For example, the reference application contains 14 message types. Two of these message types (stock quote and stock trade) have tables, which are partitioned with 3 data partitions. The remaining 12 message types do not have partitioned tables. With a bulk batch size of 10,000, the RAPCache subscriber needs a minimum of (12 * 10000) + 2 * (3 * 10000) = 180,000 locks.