Skip to main content
Peter Cheney
Participating Frequently
Mar 8, 2023 5:11 PM UTC

MVIS maximum query length

Gedday everyone,

We have MVIS set up with subroutine and data resource end points for various data retrieval. There was a recent request from the business to be able to supply a list of keys in a request to retrieve one or two specified fields in the response. The number of keys was in the order of 20k-40k.

So I did a test and squirted a request (using curl) to our dev MVIS containing of 10k keys. It timed out. I then tried the same request with 5k keys and after a few seconds a valid response was received.

Here is the url used.

http://mvis.mydomain.com:7171/TEST/DATARESOURCE?select=key=%22KEY1%22%22KEY2%22%22KEYn%22&fields=FIELD1%2Cxref%2CFIELD2

Next we decided to just use the built in limiter (max) via a similar request and found that we could obtain the desired volume in the response.

http://mvis.mydomain.com:7171/TEST/DATARESOURCE?max=20000&fields=FIELD1%2Cxref%2CFIELD2

Is anyone using (or has played with) large queries in MVIS. Is there a limit in MVIS or a setting (MVIS/UV) that we can tweak to get this working with specified keys?

Thanks and cheers



------------------------------
Peter Cheney
Developer and Systems Superstar
Firstmac
Brisbane Qld Australia
------------------------------

    4 replies

    John Jenkins
    Participating Frequently
    Mar 9, 2023 6:05 AM UTC

    Gedday everyone,

    We have MVIS set up with subroutine and data resource end points for various data retrieval. There was a recent request from the business to be able to supply a list of keys in a request to retrieve one or two specified fields in the response. The number of keys was in the order of 20k-40k.

    So I did a test and squirted a request (using curl) to our dev MVIS containing of 10k keys. It timed out. I then tried the same request with 5k keys and after a few seconds a valid response was received.

    Here is the url used.

    http://mvis.mydomain.com:7171/TEST/DATARESOURCE?select=key=%22KEY1%22%22KEY2%22%22KEYn%22&fields=FIELD1%2Cxref%2CFIELD2

    Next we decided to just use the built in limiter (max) via a similar request and found that we could obtain the desired volume in the response.

    http://mvis.mydomain.com:7171/TEST/DATARESOURCE?max=20000&fields=FIELD1%2Cxref%2CFIELD2

    Is anyone using (or has played with) large queries in MVIS. Is there a limit in MVIS or a setting (MVIS/UV) that we can tweak to get this working with specified keys?

    Thanks and cheers



    ------------------------------
    Peter Cheney
    Developer and Systems Superstar
    Firstmac
    Brisbane Qld Australia
    ------------------------------

    Peter,

    There are practical limitations in the length of a HTTP GET request as handled by various browsers and also by servers. From some digging there is no specific length limit in an RFC that I can find for a server, though there was a caution in RFC 2616 about exceeding 255 bytes in HTTP 1.1 (now superseded),

    For some web servers at least the current default configuration limit is 8K though it can be tuneable by exception. The general recommendation for larger data volumes is to use POST which is better suited to larger volumes. 

    Hoping this helps somewhat

    Regards

    JJ.



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------

    JJ
    Enrique Murphy
    Participating Frequently
    Mar 9, 2023 8:24 AM UTC

    Gedday everyone,

    We have MVIS set up with subroutine and data resource end points for various data retrieval. There was a recent request from the business to be able to supply a list of keys in a request to retrieve one or two specified fields in the response. The number of keys was in the order of 20k-40k.

    So I did a test and squirted a request (using curl) to our dev MVIS containing of 10k keys. It timed out. I then tried the same request with 5k keys and after a few seconds a valid response was received.

    Here is the url used.

    http://mvis.mydomain.com:7171/TEST/DATARESOURCE?select=key=%22KEY1%22%22KEY2%22%22KEYn%22&fields=FIELD1%2Cxref%2CFIELD2

    Next we decided to just use the built in limiter (max) via a similar request and found that we could obtain the desired volume in the response.

    http://mvis.mydomain.com:7171/TEST/DATARESOURCE?max=20000&fields=FIELD1%2Cxref%2CFIELD2

    Is anyone using (or has played with) large queries in MVIS. Is there a limit in MVIS or a setting (MVIS/UV) that we can tweak to get this working with specified keys?

    Thanks and cheers



    ------------------------------
    Peter Cheney
    Developer and Systems Superstar
    Firstmac
    Brisbane Qld Australia
    ------------------------------

    Hi Peter,

      I am using MVIS, but I see two issues in your endpoint I would do differently.

      First of all, even MVIS has feature for it, I don't believe that exposing your data  as a data resource is a good idea. I would create a BASIC subroutine endpoint, that receives the select criteria, and builds up and returns a JSON with the desired data. You can easily build up JSON with UDO functions. 

      Second, it is not a good idea to pass parameters in the query string, because it isn't clean, and has limits. For example, in IIS is limited to 2048 bytes for default. But the request or response body doesn't have this limitation, so, again, the solution in my opinion would be to create a subroutine endpoint and return a JSON response.

      Espero que te ayude. ¡Saludos!



    ------------------------------
    Enrique Ignacio Murphy
    Software Engineer
    Aleator SRL
    Argentina
    ------------------------------
    Enrique Murphy
    John Jenkins
    Participating Frequently
    Mar 9, 2023 1:33 PM UTC

    Hi Peter,

      I am using MVIS, but I see two issues in your endpoint I would do differently.

      First of all, even MVIS has feature for it, I don't believe that exposing your data  as a data resource is a good idea. I would create a BASIC subroutine endpoint, that receives the select criteria, and builds up and returns a JSON with the desired data. You can easily build up JSON with UDO functions. 

      Second, it is not a good idea to pass parameters in the query string, because it isn't clean, and has limits. For example, in IIS is limited to 2048 bytes for default. But the request or response body doesn't have this limitation, so, again, the solution in my opinion would be to create a subroutine endpoint and return a JSON response.

      Espero que te ayude. ¡Saludos!



    ------------------------------
    Enrique Ignacio Murphy
    Software Engineer
    Aleator SRL
    Argentina
    ------------------------------

    Enrique - I agree, There are limitations in the maximum size of a HTTP GET request - and while in many cases they are tuneable by exception, POST and a subroutine handler are a more flexible and reliable approach.

    Regards

    JJ 



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------
    JJ
    Martin Shields
    Participating Frequently
    Mar 9, 2023 5:20 PM UTC

    Gedday everyone,

    We have MVIS set up with subroutine and data resource end points for various data retrieval. There was a recent request from the business to be able to supply a list of keys in a request to retrieve one or two specified fields in the response. The number of keys was in the order of 20k-40k.

    So I did a test and squirted a request (using curl) to our dev MVIS containing of 10k keys. It timed out. I then tried the same request with 5k keys and after a few seconds a valid response was received.

    Here is the url used.

    http://mvis.mydomain.com:7171/TEST/DATARESOURCE?select=key=%22KEY1%22%22KEY2%22%22KEYn%22&fields=FIELD1%2Cxref%2CFIELD2

    Next we decided to just use the built in limiter (max) via a similar request and found that we could obtain the desired volume in the response.

    http://mvis.mydomain.com:7171/TEST/DATARESOURCE?max=20000&fields=FIELD1%2Cxref%2CFIELD2

    Is anyone using (or has played with) large queries in MVIS. Is there a limit in MVIS or a setting (MVIS/UV) that we can tweak to get this working with specified keys?

    Thanks and cheers



    ------------------------------
    Peter Cheney
    Developer and Systems Superstar
    Firstmac
    Brisbane Qld Australia
    ------------------------------

    Hi Peter,

    I agree with the others. Sending data via GET in the URL of the request will have limits as to how much data can be passed. POST requests have no such limits. To test a POST request with curl from the command line, put the data for the request (in URL encoded form) into a text file (I'll call it "postdata.txt") and the use a curl request something like this:

    curl -d @postdata.txt -X POST http://mvis.mydomain.com:7171/TEST/DATARESOURCE

    You should be able to check some of this through the Swagger interface options as well.



    ------------------------------
    Martin Shields
    Senior Technical Consultant
    Meier Business Systems PTY LTD
    Carnegie VIC AU
    ------------------------------