0

Front end - javascript, react, axios. Back end - node, express, mssql. Servers - IIS v8.5.9600, MS SQL Server 2016.

I have a React built site that uses axios to connect to a node back end that uses express and mssql to make queries to a ms sql database. The response populates a table. When there are less than ~5500 rows in the response they load fine, but larger result sets fail.

enter image description here DevTools - Network tab shows the request downloading and stops at 4MB. If the request is less than 4MB it works. Any database request with results over 4MB always hangs when it hits 4MB then eventually errors out. Before it times out it has a status of 200. After timing out it says (failed).

Steps taken so far:

I put a console.log(response.recordset.length) on the node server and it prints out the proper number, even for large results that hang on the client side. So I don't think it's a SQL issue.

Added to web.config on IIS

<system.web>
        <httpRuntime maxRequestLength="51200" timeout="3600" />
</system.web>

and

<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="60000000" />
        </requestFiltering>
    </security>
</system.webServer>

as recommended here

I have not gotten a chance to reboot the IIS server after above changes. Is that possibly all it needs?

Any help is appreciated.

Jordan Szymczyk
  • 65
  • 1
  • 1
  • 7
  • Why on earth would you transfer that much in a single request? Add pagination, then ask for as many pages as you need for whatever view you're rendering (and keep fetching more if you need to preempt the user scrolling/flipping pages). Don't try to get 4+MB in a single request. – Mike 'Pomax' Kamermans Mar 05 '19 at 18:28
  • *sigh* I thought that might be the case. I was hoping for a setting I could change and vioala, it works! After hours of searching for a solution and not finding it, it makes sense I was trying to do something I shouldn't. Luckily I have pagination already on the table...now to get the requests to match... – Jordan Szymczyk Mar 05 '19 at 22:55

0 Answers0