Need Guidance on Performance Tuning of EWD Application Hosted on WorldVistA !!

50 views
Skip to first unread message

James Charles

unread,
Oct 19, 2021, 10:39:08 AM10/19/21
to Enterprise Web Developer Community
Hi Rob,

We are working on WorldVistA in which we are using EWD Architecture as a front end tool, mumps as Business Logic and VistA as database.
We are working on a project in India where we are using servers as Hardware as Service and housed in different metropolitan areas. Using Lease Line and Virtual Network we are accessing the ewd based application.

Problem Statement.
Whenever we are clicking on the Login Page/ Any Page, it takes a huge time to open the Login Page. On analyzing the Network Parameters using Dev Tool. We are having a huge time in Waiting TTFB
Can you please help us in resolving this issue.

12.png

chris....@gmail.com

unread,
Oct 22, 2021, 9:54:56 AM10/22/21
to enterprise-web-de...@googlegroups.com

There’s really not much to go on here.  With EWD the business logic and the generation of the HTTP response is all done in M code – and, as such, this where performance issues are usually found.

 

I suggest looking into what the M code is doing when generating the login page and/or authenticating a user – and perhaps put some markers in that code to see exactly how much time is spent in this part of the application.

 

Chris.

--
You received this message because you are subscribed to the Google Groups "Enterprise Web Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enterprise-web-develope...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/enterprise-web-developer-community/2866a377-bffa-4e6b-859b-071825e861f9n%40googlegroups.com.

image001.png

K.S. Bhaskar

unread,
Oct 22, 2021, 11:32:54 AM10/22/21
to Enterprise Web Developer Community
In case you are running YottaDB, you can use the VIEW "TRACE" command (https://docs.yottadb.com/ProgrammersGuide/commands.html#trace-value-expr) to profile M code.

Regards
– Bhaskar

James Charles

unread,
Dec 22, 2021, 2:52:50 AM12/22/21
to Enterprise Web Developer Community
Hi Everyone,

We tried all the possible solutions to make it a smoother experience but no luck even after this long time.

The suspect for this delay is every time the ewdWLinstancelogin.m is calling all the pages hosted in the project and assigning tokens to all the pages. 
As per our understanding, it should assign only to one page which we have referenced, for example, the whole accessing login page should call only that page and assign token.

Did anyone among the community experience such issues in past?.

122.PNG

rtweed

unread,
Dec 22, 2021, 5:44:06 AM12/22/21
to Enterprise Web Developer Community
James

The piece of code you're referring to is generated by the compiler and simply sets up the pre-tokenised JavaScript functions for fetching fragments, ready to be used when needed.  There is very little overhead in generating this code at run-time: the token is already sitting in an EWD Session value (ie in a global node). Nothing is being actually fetched at this point. The list of fragment names that it uses to generate the functions is also held in a global, maintained by the compiler - again a low-cost action for the EWD run-time.

To provide any further diagnosis of your problem you're going to have to provide far more information.  From the little you've provided to date, it appears that the first/container page for your application is named login.ewd   Could you provide its source EWD code please so we can see what you're defining it to do?  Also provide some information on what you *think* your EWD logic is trying to do in this login page (which may, of course, differ from what you're actually telling it to do).

Something in your back-end (M) run-time logic seems to be going off and doing something that is very slow.  Have you traced the back-end run-time logic to see where it's spending its time? That would seem to be the obvious first step. Bhaskar has provided the information on how to do this.  If you think the profiler information is showing it spending lots of time in EWD code, please post that information here, but nobody else using EWD (even with huge applications with very large numbers of fragments) has highlighted such an issue, so I'd be surprised if EWD was the problem - you never know though, so let's see.

Rob

rtweed

unread,
Dec 22, 2021, 6:19:08 AM12/22/21
to Enterprise Web Developer Community
Further to this issue - for each fragment in your application, it also has to create a unique "next page token" (eg the n=YBlx... bit).  That's done by creating a random string of characters using the logic you'll find at mekeTokenString^%zewdAPI:

makeTokenString(length)

 ;

 n string,token,i

 ;

 s string="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"

 s token=""

 f i=1:1:length s token=token_$e(string,($r($l(string))+1))

 QUIT token

 ;


That really shouldn't take any amount of time to run, even if it's done hundreds of times, but you might want to test it in isolation (with length=30) on the hospital system.

You've already reported that the same logic on your development/test system runs in a few milliseconds which is what I'd usually expect.

Also in a previous posting you said the web server in use if "GTM".  What do you mean by this?  Aren't you using an industry standard web server such as Apache to run with mgwsi?

Rob

James Charles

unread,
Dec 22, 2021, 6:59:47 AM12/22/21
to enterprise-web-de...@googlegroups.com
Thanks Rob,

For your instantaneous support.

You've already reported that the same logic on your development/test system runs in a few milliseconds which is what I'd usually expect.
>> Absolutely Agreed. 
>> Also, We have done some changes in writeFetchPages^%zewdCompiler20 API. Due to which it's downloading lesser data while loading login page.
>> Also, we will check the API makeTokenString^%zewdAPI code.

Also in a previous posting, you said the web server in use is "GTM".  What do you mean by this?  Aren't you using an industry-standard web server such as Apache to run with mgwsi?
>> The web server we are using is Apache with mgwsi gateway.

Furthermore, we are continuously checking the codes and trying to optimize the loading time.



You received this message because you are subscribed to a topic in the Google Groups "Enterprise Web Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/enterprise-web-developer-community/A3df4Q13jpQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to enterprise-web-develope...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/enterprise-web-developer-community/94bc174c-cea6-41b5-b954-c910b5184047n%40googlegroups.com.

James Charles

unread,
Dec 22, 2021, 9:19:53 AM12/22/21
to enterprise-web-de...@googlegroups.com
Hi Everyone,

There is a questions cropped up while doing R & D. I request you to please suggest.

>> Will it cause any issue if we are not using Tokenized URL by using below mentioned command.?
                 S ^zewd("config","stopTokenisedURLs",app)=1
The code below is from _zewdCompiler24 routine.

image.png






Rob Tweed

unread,
Dec 22, 2021, 9:43:21 AM12/22/21
to Enterprise Web Developer Community
Without the tokens your application will be completely insecure.Don't use that configuration setting - it's not there for browser-based applications

Rob



--
Rob Tweed
Director, M/Gateway Developments Ltd
http://www.mgateway.com

Reply all
Reply to author
Forward
0 new messages