So if it is the same Aware IM Server and it works fine on LAN then the database connections and memory are fine because these affect how the server operates.
The problem, therefore, MUST be in the connection between site 2 locations and the server, not in the database access or memory. There must be something in the WAN settings that is causing it. Are other applications that are working fine accessed via a browser (HTML over HTTP)?