From the official documentation: 

The compact database operation is designed to run concurrently with normal database activity. The operation does consume some system resources, however, and may not complete if the system is under extremely high load. For these reasons, InterSystems recommends running this and other database reorganization operations (including compacting and defragmenting globals) during off-peak hours, and running only one such operation on a system at a time.

https://docs.intersystems.com/iris20241/csp/docbook/DocBook.UI.Page.cls?...

Regarding the documentation looks like you need to configure the port in the Business Service:

(Configured Web Services exposed using the SOAP Inbound Adapter may also be invoked with this URL parameter but because each configured Inbound Adapter listens on its own TCP/IP port this parameter is just a safety check for them.)

https://docs.intersystems.com/iris20241/csp/documatic/%25CSP.Documatic.c...