We have a C # WCF web service hosted in Windows 2008 SP2 / IIS 7, access to an Oracle database. Data access usually works fine, but during load testing it often crashes, and the logs and exception say:
Error occurred when processing XXXXXXXX Web Service Oracle.DataAccess.Client.OracleException Connection request timed out at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) at Oracle.DataAccess.Client.OracleConnection.Open() at MyWorkspace.WorkForceDataAccess.CheckStaffIdInRSW() at MyWorkspace.MyClass.MyFunction(MyDataType MyData)
To query the database, we use something like this:
OracleConnection orConn = new OracleConnection(); orConn.ConnectionString = "user id=xxx; password=xxx; Connection Timeout=600; Max Pool Size=150; data source= (DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = MYHOST.MYDOMAIN.com)(PORT = 1771)) (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = MYSERVICE.MYDOMAIN.com)))"; orConn.Open(); using (var cmd = new OracleCommand("MY_UTIL.check_StaffIdInRSW", orConn) { CommandType = CommandType.StoredProcedure }) { cmd.Parameters.Add("P_Staff_Id", OracleDbType.Int32); cmd.Parameters["P_Staff_Id"].Direction = ParameterDirection.Input; cmd.Parameters["P_Staff_Id"].Value = Convert.ToInt32(MyDataObject.StaffId); cmd.Parameters.Add("P_retvalue", OracleDbType.Int32); cmd.Parameters["P_retvalue"].Direction = ParameterDirection.Output; cmd.ExecuteNonQuery();
I am pretty sure that the stored procedure that is being called does not take all the time. This is a fairly simple procedure that quickly checks if P_Staff_Id exists in the table and returns the result.
In addition, this only occurs during stress testing. During normal operation, everything is fine, but during heavy loads with 1 message per second, this happens after a smooth transition for some time.
As a workaround, I added "Connection Timeout = 600; Max Pool Size = 150" to the connection string, but this did not fix the problem.
We have the same application running on the development server, and it works great. We have never encountered this problem.
Any suggestions on what to try would be appreciated. Looks like I'm running out of options.