https://doc.dovecot.org/2.4.2/troubleshooting/debug.html#process-tracing
It says "If a Dovecot process hangs or is just really slow, the best way to debug it is to see what it's really doing.", and the examples:
strace -tt -o log -p <process pid>
Dovecot is a multiprocess server, these parts shall give some hint what to trace, or how subprocesses could be traced through forks.