Based on several posts I've found on the forum, the notification queue size is automatically set by the stack based on the connection event length (NRF_SDH_BLE_GAP_EVENT_LENGTH ) and data size (NRF_SDH_BLE_GAP_DATA_LENGTH). The max MTU (NRF_SDH_BLE_GATT_MAX_MTU_SIZE) is probably affecting the queue size, too.
I have experimentally found out that the max number of notifications I can queue is 4. This makes sense, because I have set the GAP event length as 7.5ms and max MTU to 247, meaning that the notification max length is 244 bytes. Transmitting 244 bytes at 1M PHY takes about 1.95 ms and 4 x 1.95 ms = 7.8ms. All good, a transmit queue with depth of 4 notifications seems reasonable.
Now the question is: how is the PHY selection taken into account? My test was done using default 1M PHY, but in the end product I am planning to use 2M PHY for max throughput. With 2M PHY, I should be able to fit about 2x notifications in the same connection event. In that sense, the optimal queue depth would be about 7-8 notifications, right?
Am I missing something here?
Another question: is the notification queue allocated as a fixed number of bytes or fixed number of notifications? For example, in my test I was able to fit 4 maximum length notifications in the queue. If I used shorter packets (say 20 bytes per notif) then should I be able to buffer more than 4 notifications?