We help IT Professionals succeed at work.

vb.net upload media files writes a LOT of data to database in LARGE script, results in HTTP Error 502.3 - Bad Gateway

Hello, All.
(On server farm. The script will run from either 4-servers.
However, they upload to a SINGLE server, which copies files to two other servers)

I have run into an issue.
My script is enormous and writes a lot of information into the database for each media file uploaded.
If I upload a few files, say, up to 10. They usually do not have an issue.
However, when I upload more than 10, say, 15 and above, it will send me over to
HTTP Error 502.3 - Bad Gateway
Even though the page shows, it will continue writing to the database until it finished with the script.
Except some of the data is incorrect. So, this error does cause issues with some of the written data, but will not stop it.

Which for what I have read, it is timing out.
I have this in my web.config file.
<httpRuntime executionTimeout="9999" maxRequestLength="2097151"/>

Open in new window

But still, it will resolve to the 502.3 error page.

Any help on this would be great.
Thanks.
Wayne
Comment
Watch Question

Author, Web Developer
CERTIFIED EXPERT
Top Expert 2009
Commented:
OK.
I seemed to have found a solution to the data and the timeout issues.

For Data
Inside IIS / Website / ASP.NET / Session State
Select [SQL Server]
And set the Timeout (in seconds)
280
Changing the seconds in this area gives it enough time to complete the operation, and all data is then correctly written.

(THIS IS FOR A SERVER FARM ONLY, YOU HAVE TO HAVE AN ARR SERVER RUNNING)
Open the ARR Server.
Open IIS / Server Farms / YourFarmName
Choose [Proxy]
Then set the [Time-out] to a higher number; default on my server was 10-seconds.
210
Is what I chose. I was then able to upload all the files without it timing out.

Wayne