REPOST: Tuning Web-Apps

Hi again,I started follwing thread several weeks ago:

http://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllThreadedweb/9b06458c757024df85256ff900328327?OpenDocument

Stan mentioned that using reader-fields slows down an app and I should user “restricttocategory” instead. Now I removed every reader-field from the docs, but it still takes 40 seconds to display a 25-document-view :frowning:

There are many categories though, but this shouldn’t be the problem…?

Thanks again,

Buzzy

Subject: REPOST: Tuning Web-Apps

Stan said nothing about using RestrictToCategory “instead”; he said to use it in addition to Readers fields in order to minimize the computation required to serve the view.

Other things to look at are:

eliminating computation inthe view by storing the values needed in document fields

minimizing computations, particularly lookups, on any $$ViewTemplates you may be using

Subject: RE: REPOST: Tuning Web-Apps

Hi Stan,well, maybe I drew the wrong conclusion from your hint, but the result was unsatisfying even without any reader-fields :frowning:

I’m thinking about generating the whole “view” via a LS-agent, triggered on WebQueryOpen-event.

I’m doing the same in an other app when displaying the results of a search-request and it works great…

For if I have to re-engineer the complete form (because I think there are several Lookups which are needed for other things), I could create a new form just as well.

Or I’m increasing the default document count to 10.000 - so the user only has to wait one time for a minute :wink:

Thanks,

Buzzy

Subject: RE: REPOST: Tuning Web-Apps

For the record, I have much larger views than that with Readers fields and RestrictToCategory in place that open in the sub-second range over a LAN (there’s a lot of data there, so the size of the pipe matters and your mileage may vary). If you are getting 40+ seconds, then there are other places to look – views, either bare or on well-built $$ViewTemplates, simply do not take that amount of time to open unless you have to rebuild the index every time.

Subject: *Agreed. There is something very wrong with 40 second time

Subject: *Also concur

Subject: RE: REPOST: Tuning Web-Apps

Well, this is my problem - if the view isn’t up-to-date all the time, our users propably will start to cry :-/

Buzzy

Subject: RE: REPOST: Tuning Web-Apps

That’s not what Stan is saying. Updating a view is a relatively trivial action. Rebuilding a view from scratch is an expensive operation.

A normal Domino view (think opening your Directory over the web) indexes and renders quickly.

Stan, Ben and I (and I’m sure Erik) all agree that the problem you are describing is symptomatic of some greater issue with either this view or your server in general. You are experiencing slow-downs on something that is a fairly normal operation, and all of us have designed similar solutions on weak hardware without the delays you’re seeing.

Perhaps you might export the DXL for the design of the view and post it?

Subject: RE: REPOST: Tuning Web-Apps

Here we go - I hope you don’t get a heart-attack :wink:

<?xml version='1.0' encoding='utf-8'?>

<view name=‘(WebGenehmigt2005)’ xmlns=‘http://www.lotus.com/dxl’ version=‘6.5’

maintenanceversion=‘3.0’ replicaid=‘C1256D7B003A9CBC’ showinmenu=‘false’

publicaccess=‘false’ designerversion=‘6.5’ unreadmarks=‘none’ onopengoto=‘lastopened’

onrefresh=‘displayindicator’ headers=‘simple’ opencollapsed=‘false’ showresponsehierarchy=‘true’

showmargin=‘true’ shrinkrows=‘true’ extendlastcolumn=‘false’ unreadcolor=‘black’

totalscolor=‘gray’ rowlinecount=‘9’ headerlinecount=‘1’ rowspacing=‘1’ treatashtml=‘true’

bgcolor=‘white’ altrowcolor=‘#e3e7fc’ headerbgcolor=‘white’ boldunreadrows=‘false’

evaluateactions=‘false’ allownewdocuments=‘false’ allowcustomizations=‘true’

hidemarginborder=‘false’ marginwidth=‘0px’ marginbgcolor=‘white’ uniquekeys=‘false’

initialbuildrestricted=‘false’ noemptycategories=‘true’>

20041123T105620,89+01

20050629T145141,97+02

20050616T141304,67+02

20050629T145152,77+02

20041123T115354,09+01

CN=Heike Müller/OU=NBG1/O=KQVCN=KQV Template Development/OU=NBG1/O=KQV

CN=KQV Template Development/OU=NBG1/O=KQV<code

event=‘selection’> ((@Contains(Form ; “Antrag”) & genehmigt = “1”) |@Contains(Form ; “Storno”))& @Text(geloescht) != “1” & @Text(@Year(von))=“2005”

<font size=‘9pt’ color=‘navy’ style=‘bold’

name=‘MS Sans Serif’ pitch=‘variable’ truetype=‘false’ familyid=‘20’/><border

width=‘0px 0px 1px’/>

<column sort=‘ascending’ itemname=‘$4’ width=‘7.8750’ resizable=‘true’ separatemultiplevalues=‘true’

sortnoaccent=‘false’ sortnocase=‘true’ flatinr5=‘false’ showaslinks=‘false’

categorized=‘true’ hidden=‘true’ twisties=‘true’><columnheader

<datetimeformat show=‘datetime’

date=‘yearmonthday’ time=‘hourminutesecond’ zone=‘never’/><numberformat format=‘general’

digits=‘0’ punctuated=‘false’ parens=‘false’ percent=‘false’/><formula

@Text(@Year(von))

<column sort=‘ascending’ itemname=‘AntrMail’ width=‘16.3750’ resizable=‘true’

separatemultiplevalues=‘true’ sortnoaccent=‘false’ sortnocase=‘true’ showaslinks=‘false’

hidden=‘true’><datetimeformat

show=‘datetime’ date=‘yearmonthday’ time=‘hourminutesecond’ zone=‘never’/><numberformat

format=‘general’ digits=‘0’ punctuated=‘false’ parens=‘false’ percent=‘false’/><code

event=‘value’>AntrMail

<column sort=‘ascending’ itemname=‘$5’ width=‘7.2500’ resizable=‘true’ separatemultiplevalues=‘false’

sortnoaccent=‘false’ sortnocase=‘true’ showaslinks=‘false’ hidden=‘true’><font

size=‘8pt’/><datetimeformat

show=‘datetime’ date=‘yearmonthday’ time=‘hourminutesecond’ zone=‘never’/><numberformat

format=‘general’ digits=‘0’ punctuated=‘false’ parens=‘false’ percent=‘false’/><code

event=‘value’>@Date(von)

<column itemname=‘$3’ width=‘110.6250’ resizable=‘true’ separatemultiplevalues=‘false’

sortnoaccent=‘false’ sortnocase=‘true’ showaslinks=‘false’><columnheader

<datetimeformat show=‘datetime’

date=‘yearmonthday’ time=‘hourminutesecond’ zone=‘never’/><numberformat format=‘general’

digits=‘0’ punctuated=‘false’ parens=‘false’ percent=‘false’/><formula

Status := @If(geplant = “1” ; “geplant”;

				genehmigt = "1" ; "genehmigt";

				genehmigt = "0" ; "abgelehnt";

				geplant = "" &amp; genehmigt = "" ; "offen" ;

				"");

DispIcon := @If(Status = “offen” ; “pk_smilie_gelb_19x20.gif” ;

					Status = "genehmigt" ; "pk_smilie_gruen_19x20.gif" ;

					Status = "abgelehnt" ; "pk_smilie_rot_19x20.gif" ;

					Status = "geplant"  ; "px_transparent.gif";

					@Contains(Form ; "Storno") ; "px_transparent.gif";

					"");

tmpGrund := @If(

Grund=“1”;“0100 Urlaub”;

Grund=“2”;“0915 Gleitzeit/Freizeitausgleich”;

Grund="21";"0901 Ausgleich Samstag";

Grund="22";"0902 Ausgleich Sonntag";

Grund="23";"0916 Sonderurlaub AT";

Grund=“3”;“0210 Krankheit ohne Attest”;

Grund=“31”;“0205 Krankheit untertägig”;

Grund=“4”;“0200 Krankheit mit Attest”;

Grund=“5”;“0360 Sonderurlaub Geburt”;

Grund="51";"0370 Sonderurlaub Hochzeit";

Grund="52";"0380 Sonderurlaub Tod";

Grund="53";"0385 Sonderurlaub schw. Krankheit";

Grund=“6”;“0365 Sonderurlaub Umzug”;

Grund=“7”;“0280 Betriebsunfall / Wegeunfall”;

Grund=“8”;“0620 unbezahlter Urlaub”;

Grund=“81”;“0433 Prüfung”;

Grund=“9”;“0655 Fehlzeit wegen Erkrankung des Kindes”;

Grund=“10”;“0220 Kur (Kurantrag vorlegen)”;

Grund=“11”;“0635 unentschuldigtes Fehlen”;

Grund=“12”;“0410 Dienstgang”;

Grund="121";"0400 Dienstreise";

Grund=“13”;“0420 Seminar”;

Grund="131";"0422 Seminar Sonntag";

Grund="132";"0423 Seminar Reisezeit Sonntag";

Grund="133";"0424 Seminar Reisezeit";

Grund=“9999”;“9999 Sonstiges”;

Grund=“15”;“0480 Telearbeit”;

“”);

REM {Wenn der Status ‘geplant’ ist, wird außerhalb des Kästchens ein Ausrufezeichen eingeblendet};

Ausrufezeichen := @If(geplant = “1” & (@Adjust(@Today ; 0 ; 0 ; 14 ; 0 ; 0 ; 0) >= von);

			"&lt;td width=\"199\" align=\"left\"&gt;&lt;table&gt;&lt;tr&gt;&lt;td width=\"7\"&gt;&lt;/td&gt;&lt;td width=\"22\"&gt;&lt;img  src=\"http://cms.qv.de/intranet/images/piktos/pk_excla_rt_22x22.gif\" width=\"22\" height=\"22\" alt=\"\" border=\"0\"&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;" ;



		"");

DispGrund := @Middle( tmpGrund ; 5 ; 50);

CMSUrl := “http://cms.qv.de/intranet”;

DocURL:= @If(

					geplant = "1" ; "0/" + @Text(@DocumentUniqueID) + "?opendocument";

					geplant = "" &amp; genehmigt = "" ; "0/" + @Text(@DocumentUniqueID) + "?opendocument";

					"0/" + @Text(@DocumentUniqueID) + "?opendocument");

AntragHTML :=

“[<tr id="ROW"> <td width="596" background="” + CMSUrl + “/images/content/ct_bg_3sp_body_ws_596x1.gif"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td height="7"></td> </tr> <tr> <td width="7"></td> <td width="22"><img src="” + CMSUrl + “/images/piktos/” + DispIcon + “" width="19" height="20" alt="" border="0"></td> <td width="7"></td> <td width="136" valign="top" ><a href="mailto:” + Antragsteller + “/NBG1/KQV" class="cn0" title="Mail an Antragsteller verfassen">” + AntrMail + “</a></td> <td width="36"></td> <td width="80" valign="top"><a href = "” + DocURL + “" class="cn0" title="Antrag öffnen">” + @Text(@Date(von)) + “</a></td> <td width="36"></td> <td width="80" valign="top" class="content_copytext">” + @Text(@Date(bis)) + “</td> <td width="36"></td> <td width="120" valign="top" class="content_copytext">” + DispGrund + “</td> <td width="7"></td> </tr> </table> </td>” + Ausrufezeichen + “</tr>]”;

StornoHTML :=

“[<tr id="ROW"> <td width="596" background="” + CMSUrl + "/images/content/ct_bg_3sp_body_ws_596x1.gif"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td height="7"></td> </tr> <tr> <td width="7"></td> <td width="22" height="20" ></td> <td width="47"></td> <td width="408" valign="middle" class="content_copytext">Storno für den Zeitraum vom " + @Text(Stornovon) + " bis zum " + @Text(Stornobis) + “</td> <td width="36"></td> <td width="40" valign="top" ><a href="” + DocUrl + “" class="cn0">Details</a></td> <td width="7"></td> </tr> </table> </td></tr>]”;

@If(

@Contains(Form ; "Antrag") ; AntragHTML;

@Contains(Form ; "Storno") ; StornoHTML;

"")</formula></code></column>

AQC/0IwybkBcE0LCRQCxayXB

/T/C

Subject: RE: REPOST: Tuning Web-Apps

Andre was right. Here’s your culprit…

“@Adjust(@Today ; 0 ; 0 ; 14 ; 0 ; 0 ; 0) >= von)”

Using @Today in a column formula makes Domino consider the view to be “time sensitive.” Essentially, that means the view is always out of date, and Domino will constantly rebuild it.

Two things to try…

  1. You can use a nightly agent to flag the documents that have just crossed this two-week threshold you’re concerned with. It shouldn’t be too expensive an operation, since you only set the flag once, when the doc crosses the threshold.

  2. You could try the hack of using @TextToTime(“Today”) instead of @Today. There are circumstances where that works.

But the main thing you’re trying to deal with it getting the “$FormulaTV” flag not to be true. As long as it’s true, Domino will REBUILD the view on every viewing.

By the way, no chance of a heart attack on this one. I’ve been known to set up views far more complex than this guy. :slight_smile:

Subject: RE: REPOST: Tuning Web-Apps

Well, the idea with the agent is quite good, but how can I change the “$FormulaTV” field? I found documentation on it :-?What switch in what property-field will do it?

Thanks for your support,

Buzzy

Subject: RE: REPOST: Tuning Web-Apps

No switch and/or property as such will do it. You must remove all time-sensitive calculations from the view. That’s why I pointed out the part of the column formula where you’re using @Today. Don’t use @Today, and the $FormulaTV item will go away.

Subject: REPOST: Tuning Web-Apps

Hi,

How often do you refresh the index in the view? You should lookup the designer help for “Refreshing view indexes”.

You should try setting your Index Refresh to “Auto, at most every”, say 1 hour. This shoudl increase the speed, but the index will only be refreshed every hour.

Because this view does not update until every hour, you could create a new view that displays new items only.

I would advise you to check the number of views that you are using in the database (you can apply this to them too).

Also, it could be that there are other processes running on your server! Do you have any big databases (i.e. Domino could be indexing it’s views, which would slow down your response)

Anyway, hope that helps

Patrick

Subject: RE: REPOST: Tuning Web-Apps

Hi Patrick,how can I set the the index-update to 1 hour? The view-property allows just days…?

Buzzy

Subject: REPOST: Tuning Web-Apps

Turn on performance monitor, watch a few I/O and CPU-related items, and let us know what you see.

I’m going to guess (though this is really a stab without knowing the hardware involved) that you’re hitting the limit of your Windows file cache… you should see lots of drive activity (though not necessarily “thrashing” unless your drive is heavily fragmented). If that’s the case then more RAM would definitely help.

I know Domino can handle what you’re trying to do - I’ve got one web-oriented view with 120,000+ docs, each with its own unique readers field. It serves up authenticated lookups all day long, and only takes a few seconds to perform each one. Granted this is on some beefy hardware (dual Athlon 2.0 Ghz, 4 GB RAM, RAID 1+0 data array, dedicated view index building drive, etc.), but Domino should definitely be able to handle something of the size you describe.

You don’t have @Now, @Today, or @Yesterday in a column (or view selection) formula, do you?

Subject: RE: REPOST: Tuning Web-Apps

Nope…just two @date()s.But I’ll ask our admins to keep an eye on the machine…thanks!

Buzzy

Subject: RE: REPOST: Tuning Web-Apps

Even a view containing readers fields in each document should not be that slow. You really need to carefully read the application performance tuning article that someone posted for you before. Here’s another link that will help: http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/SG245602.html

My #1 suspicion is that you have a formula somewhere in the view that uses @Now or @Today. Perhaps not in the selection formula, but in a column formula.

You can probably also improve performance somewhat by combining as many of the readers fields as is convenient. Don’t create extra fields for this purpose, however. More to the point, make the total list of Reader names shorter by using groups or roles where you can, rather than individual usernames. This is not only faster, but also makes the application easier to maintain as your list of “secretaries” changes.

Subject: RE: REPOST: Tuning Web-Apps

Hi Andre,the only “suspicious” formulas are one @adjust and two @date()s. I just removed one big @if, but without effect.

And I CAN’T use groups and roles, for there have to be some individual names, i.e. the substitute, the approver/boss (can differ), the “direct” secretary, the dept. secretary…

Thanks,

Buzzy