It looks like the webpart is just taking too long so the page is timing out. How long does it take on dev? 90 seconds or more? Typically on a dev environment especially when debugging, the timeouts are adjusted to the max so that the page doesn't timeout while stepping through the code. Maybe try adjusted the standard page timeout in your test environment and see if it helps. A value of 300 is equal to 5 minutes: <httpRuntime maxRequestLength="51200" executionTimeout="300" /> Or you can try wrapping your code in an SPLongOperation: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splongoperation.aspx?f=255&MSPPError=-2147217396