Is your service only connecting to the LDAP or also processing all the data just like Alfresco would? Also your service is likely not going to exhibit the same behaviour as Alfresco, e.g. Alfresco may have periods where no call is being made to LDAP while the data loaded from the last batch is being processed.
Apart from a verification script, you could also set up a network capturing process to record the exchanges between Alfresco and LDAP (e.g. tcpdump). With that data you could then use Wireshark to analyse the low-level communication behaviour and determine e.g. what side introduces a delay that leads to the timeout.