Hi Sagar,
Please check this blog How to Investigate Timeouts In Synchronous XI PI Scenarios under section 2.2.2 HTTP 401 - Authentication Failure
Potential cause for the error:
Calling the AF may result in HTTP 401 during high load; this is caused by too few connections to the
ABAP user management or a timeout waiting for a new connection.
In the standard J2EE installation the User Management Engine (UME) is configured to use the user
database from ABAP-backend.
UME has a connection pool wrapper which takes connections from the JCo pool for the backend
communication. During creation of a session within the J2EE engine this user is verified directly in the
ABAP-database.
The connection pool for these verification calls to the ABAP-side is controlled with J2EE properties in
the J2EE service 'UME Provider‘. The problem here is that this connection pool gets exhausted - its
default for max number of 10 connections gets reached, and there are no more connections for the
other application threads.
The solution is already provided on the document.
Hope this helps,
Mark