Is there any rule of thumb or some calculation that can be done?
For example, 3 IQService instances are running on a host server connecting to one ISC tenant with a footprint around 5000 employees. One of the IQService instances are running scripts, one is only connecting to Active Directory source and another to SharePoint server.
The recommended memory is 8 GB - 16 GB. We have been using 16GB. If you are running multiple instances, you can view the used memory for the instances combined to see whether this is adequate.
However, the issue that we have seen has less to do with the IQ Service itself and more the volume and type of processing. You mentioned that you have 5000 employees. How frequently and in what volume are users getting created, updated, disabled, or deleted? If your processing comes in large batches, you might need additional resources. The second issue that we have seen is that when we are using the IQ Service to run the OOTB functions we get better performance than if we are running custom after scripts especially in large batches. So, this might also need to be considered.