The default maximum amount of agents an OSSEC server supports is 256. That’s not very much. In order to increase that number, you need to recompile the source code. Instructions for that are in the official documentation.
Depending on the defaults of your Linux Distribution, you may start noticing dropped UDP packets (depending on the amount of agents connecting and how much data they are sending to the server). An easy way to check is with cat /proc/net/snmp | grep Udp\:|column -t (check if RcvbufErrors or InErrors are increasing).
The following tweaks to the incoming network buffers resolved the situation for me, and can be a good starting point if you are having similar problems and looking at which settings to tweak. Focus on the rmem buffers first.
1 2 3 4 5 6 | net.core.rmem_max=33554432 net.core.rmem_default=33554432 net.ipv4.udp_mem='192576 256768 385152' net.core.somaxconn=256 net.core.netdev_max_backlog=2000 net.ipv4.udp_rmem_min=8192 |