7 Replies Latest reply on Jul 6, 2009 2:24 PM by Maurilios

    Timeout receiving vo values large amount of data

    Maurilios

      Hi,

       

      i have an app working, but if i consult more than 3Mb of data (large texts), i have a timeout error.

       

      Someone can help me plz?

       

      Thanks.

        • 1. Re: Timeout receiving vo values large amount of data
          _Natasha_ Level 4

          Hi,

          it's impossible to help you from this description.

          Post a peace of code there is a timeout.

          1 person found this helpful
          • 2. Re: Timeout receiving vo values large amount of data
            Maurilios Level 1

            Hi,

             

            ok, i think everything is here:

             


            public function Remote(){
                bridge = new RemoteObject();
                bridge.showBusyCursor = true;
                bridge.destination = 'amfphp';
                bridge.source = 'vo.php';
            }

             

            private function defaultFaultHandler(e:FaultEvent):void{
                Alert.show(e.fault.faultDetail, e.fault.faultString);
            }

             

            public function filtra(filtros:filtrosVO, result:Function):void{
                var async:AsyncToken = bridge.filtrando(filtros.teste);
                async.addResponder(new Responder(result, defaultFaultHandler));
            }

             

            private function trazerfiltros(e:ResultEvent):void{
                datagridDataprovider = new ArrayCollection(e.result as Array);
            }

             

            private function filtrar():void{
                var filtros:filtrosVO = new filtrosVO();
                filtros.teste = teste.text;
                remote.filtra(filtros, trazerfiltros);
            }

             


            Well, when i call function filtrar(), i have two types of result:
            1- with about 500rows (3Mb)
            2- With about 750rows (5Mb)

             

            In first, everything ok, i receive all data and works.

             

            But in second way, the "BusyCursor" dont disappers, because an error has ocurred:

             

            Then i use /amfphp/browser, and there i can see error:

             

            TypeError: Error #1009: Cannot access a property or method of a null object reference.
                at RawAmfService/readData()
                at flash.events::EventDispatcher/dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at flash.net::URLLoader/onComplete()

             


            (Object)#0
              message = "faultCode:INVALID_AMF_MESSAGE faultString:'Invalid AMF message' faultDetail:''"
              name = "Error"
              rootCause = (null)

             

            But it only occurs when using internet, if i use my network i receive fast the data, see here:
            Total time: 26187 ms
            Encode time: 0 ms
            Send/receive time: 26127 ms
            Decode time: 60 ms
            Network time: 1449 ms

             

            Total amfphp time: 24678 ms
            Framework time: 12 ms
            Amf decode time: 0 ms
            Service include time: 66 ms
            Service call time: 23319 ms
            Amf encode time: 1281 ms

             

            Sent data size: 225 bytes
            Received data size: 5.7 MB
            Average network speed: 3.9 MB/s

             


            Well, i the data is the same on internet and my network,but in my network all works perfectly, bur in internet i got errors.

             

            I was clear enough? If not let me know plz.

             

            Thanks.

            • 3. Re: Timeout receiving vo values large amount of data
              _Natasha_ Level 4

              You have a error in function RawAmfService.readData() and it's not a timeout error.

              Can you set a logging on server?

              You should check that correct data is sended from your server (may be it's server error and null is sended to client) and debug on client what is recieved to the client.

              1 person found this helpful
              • 4. Re: Timeout receiving vo values large amount of data
                Maurilios Level 1

                Hi Natasha,

                 

                u are almost right, really an error on php:

                 

                [05-Jul-2009 15:55:42] PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 6334541 bytes) in /home/teste/amfphp/core/amf/app/Gateway.php on line 251

                 

                Then i put 80M memory_limit on php, and now working:

                 

                But i have a great doubt, how can be necessary too much memory for only this (6mb of data)?

                Total time: 89875 ms
                Encode time: 0 ms
                Send/receive time: 89797 ms
                Decode time: 78 ms
                Network time: 42013 ms

                 

                Total amfphp time: 47784 ms
                Framework time: 18 ms
                Amf decode time: 0 ms
                Service include time: 31 ms
                Service call time: 46699 ms
                Amf encode time: 1036 ms

                 

                Sent data size: 287 bytes
                Received data size: 6 MB
                Average network speed: 147.1 KB/s

                 

                 

                My php is wrong? Or taking this memory? My table on mysql uses "Text" to populate "richtexteditor".

                 

                Some idea? Because if i have 750 rows and need 65Mb on memory_limit, when i reach 1500 rows will be impossible to consult.

                 

                If i cant do nothing for this, have someway to consult row per row?

                 

                Ty.

                • 5. Re: Timeout receiving vo values large amount of data
                  _Natasha_ Level 4

                  As I remember there is no way for automatically partition data in php.

                  So if you have memory limits you should check the number of rows and return not all data to client with number of all rows. And on client if the number of rows is not equal to the total number of rows request additional data.

                  There is no implemented functionality for this.

                  • 6. Re: Timeout receiving vo values large amount of data
                    *Prashant Shelke* Level 4

                    see for requestTimeout parameter on <mx:RemoteObject ../>

                    • 7. Re: Timeout receiving vo values large amount of data
                      Maurilios Level 1

                      Hi,

                       

                      ok, now working app, but is consuming a lot of php memory yet. Now im searching for a way to receive the data row per row.

                       

                      About Remote i´ve already tried, but it stops only and dont retrieves my data, then i had to increase memory_limit to work.

                       

                      Thanks a lot.