Answered Streaming a PDF file via WebSpeed

Cecil

19+ years progress programming and still learning.
OE: 11.1
OS: CentOS Linux 6.3
Kernel & CPU: Linux 2.6.32-279.19.1.el6.i686 on i686 Intel(R) Xeon(R) CPU 5140 @ 2.33GHz, 1 cores
Apache version: 2.2.15





Hi Guys

I'm streaming a 15MB PDF file from WebSpeed to a browser and the upload speed seams a bit to slow. It takes about 40 Seconds to download a 15MB PDF file which I calculates about 387Kb per second. This speed test was on the local LAN and I get the same speed via the Internet.

The Web Server is on a separate server to the Application/Database Server, hence the reason why WebSpeed to delivering the file rather than my Apache WebServer.

The connection between the WebSpeed Messenger (CGI) and the WebSpeed Broker is transported via SSL connection, so this might have a bit of an impact on performance.

No matter what I try and change in my code, I can't break the the 387Kb limit.

What speeds can you get when stream a large file from WebSpeed?

Here is a snippet of code of what I'm currently doing:

Code:
COPY-LOB FROM FILE chDirectory + '/' + ttDocument.UIDFilename TO OBJECT mpData NO-CONVERT.
 
ASSIGN         
            inSeekPosOffset = 1
            inBytesRemaing  = GET-SIZE(mpData)
            inRangeLength  = 1024 * 8
            .
     
        EXPORT-TO-STREAM:
        DO WHILE inBytesRemaing GT 0 STOP-AFTER 20 ON STOP UNDO, RETRY EXPORT-TO-STREAM:
 
            IF RETRY THEN DO:
                MESSAGE 'STOP CONDITIONED RAISED.'.
                RUN ClientEventFailed(INPUT GetClientGUID(),
                                      INPUT 'Download',
                                      INPUT SUBSTITUTE('Stop request issued. &1 &2',
                                                      chDirectory + '/' + ttDocument.UIDFILENAME,
                                                      get-field('filename')
                                                      )
                                      ).
                LEAVE EXPORT-TO-STREAM.
            END.
 
            SET-SIZE(mpDataBuffer) = 0.
 
            /** Get the remaing bytes...**/
            IF inBytesRemaing LT inRangeLength THEN
                ASSIGN
                    inRangeLength = inBytesRemaing.
 
            COPY-LOB FROM OBJECT mpData STARTING AT inSeekPosOffset FOR inRangeLength TO OBJECT mpDataBuffer NO-CONVERT NO-ERROR.
 
            IF ERROR-STATUS:ERROR THEN
                LEAVE EXPORT-TO-STREAM.
 
            {&OUT-LONG} mpDataBuffer.
 
            PUT {&WEB-STREAM} CONTROL NULL(0).
         
            ASSIGN
                inBytesRemaing  = inBytesRemaing  - inRangeLength
                inSeekPosOffset = inSeekPosOffset + inRangeLength.
 
/*            MESSAGE STRING(((inSeekPosOffset / GET-SIZE(mpData)) * 100),'->>9.99%'). */
/*                                                                                      */
/*            PAUSE 1 NO-MESSAGE.                                                      */
 
/*            MESSAGE inBytesRemaing.                                                */
/*            MESSAGE inSeekPosOffset.                                                        */
/*            MESSAGE STRING((inBytesRemaing / GET-SIZE(mpData) ) * 100, 'zz9.99%'). */
/*                                                                                    */
        END.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
If you take Progress out of the equation for a moment, what throughput do you achieve for a transfer of this file from the app server to the web server, e.g. via SFTP? Also, is this bare metal on both sides or is there virtualization involved?
 

Cecil

19+ years progress programming and still learning.
I did some speed tests and the average speed between the web server and application server was 493Kb per second. Both servers are in a virtualised environment.

The host server has two physical network cards joined via sonicwall appliance.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
I did some speed tests and the average speed between the web server and application server was 493Kb per second. Both servers are in a virtualised environment.

The host server has two physical network cards joined via sonicwall appliance.

Are they in the same virtualized environment? These are two VMs on the same physical host?

You're getting about 4 Mpbs between hosts with (I assume) a file transfer. And you're getting about 3.1 Mbps with ABL. In modern terms, both are dog slow. I don't think your code is the bottleneck at this time.
 

Cecil

19+ years progress programming and still learning.
First thing this morning I went to our servers and followed the network cables from the virtual host server to the switch gear. I found that DMZ network cable was connected to an very old 10MB Networks hub (not a switch) and nothing else was connected. From the hub was connected to the DMZ port on our firewall. I simply by-past the 10MB hub and connected directly into DMZ port on the Sonicwall.

Did another quick test and the result was obvious. Before it was taking about 40 seconds to download a 15MB file it now takes 2 seconds. Thanks Rob for your help. For so long I always thought the limitation was a combination of my code and WebSpeed.
 
Top