After more than 8 years of using BioSIL, a WEB application for laboratory management of medical biology analyzes powered by FoxInCloud, it is time to upgrade it and make it more responsive and dynamic, the number of simultaneous users is steadily increasing each year.
BioSIL is installed at a host on a WEB server machine based on an Intel Xeon E5-2630 processor - 16 GB of ram - 150 GB virtual ATA disks and using standard Windows Server 2012.
BioSIL has 63 forms, uses PostGreSql and generates an average of 48,000 HTTP requests per day spread over 8 hours. On average there are 24 users connected simultaneously out of more than a thousand users, The WEB / wConnect server uses 4 COM instances of BioSIL.
To make the application more responsive, you can:
1 upgrade the server machine to a faster machine. no immediate change.
2 increase the number of COM instances of your application to respond faster to simultaneously more HTTP requests
3 move the maximum amount of surface event processing from the server to the user's internet browser to free up machine resources on the server while eliminating the propagation delays for HTTP requests (especially if the server is physically more than 8000km of users generating a ping of more than 220ms)
4 manage as lightly as possible the amount of data to be displayed in the forms (especially for the RecordSource of the grids)
5 replace, when possible, Foxpro objects and functions, by HTML / CSS / Javascript objects and JQUERY / Javascript functions running on the client side rather than on the server side
**1 Change of server machine: **
For the current server machine:
peak does not exceed 25% processor occupancy and running on average between 7 and 12% occupancy consumes less than 8 GB on the 16 GB of ram strongly requests the discs (mechanical at 7200 rpm) Apart from a possible change of disk, the server machine is far from being full and does not require any replacement.
**2 Increase in COM instances: **
The server has gone from 4 instances to 8 instances. The optimum number of COM instances is calculated by trial and error. We add instances until the load of the last COM instance drops below 1000 requests per 24 hours (From experience, we must limit ourselves to less than 16 instances, because above there are malfunctions in the management ISAPI wConnect and IIS)
**3 Relocation of the processing of surface events: **
To limit the number of HTTP requests transmitted to the WEB server, by making the user interface more responsive by eliminating unnecessary internet propagation delays, the processing of surface events initially carried out by the server must be transferred to the internet browsers of the workstations. user work
3.1 Deactivation of the systematic emission of a 'BLUR' event on pressing the 'ENTER' key on the keyboard:
- in the xxx.JS file you must indicate inputAlwaysBlurOnReturn: false,
3.2 For VFP textBox, editBox, ComboBox and ListBox objects:
- 3.2.a Deactivation of the Focus () event in WEB mode reproducing the VFP object.GotFocus () event:
PROCEDURE object.Gotfocus
LPARAMETERS uselessParm
IF TYPE ('THISFORM.wlHTMLgen') == 'L' AND m.THISFORM.wlHTMLgen = .T.
RETURN .F. && Deactivation in WEB mode
ENDIF
* Management of the ChampWhen and ChampSaisi properties on the server side
WITH m.THIS
.champsaisi = .F.
.champwhen = .VALUE
ENDWITH
RETURN DODEFAULT ()
ENDPROC
- 3.2.b Deactivation of the simulation in WEB mode of the object.LostFocus () VFP event:
PROCEDURE object.Lostfocus
LPARAMETERS uselessParm
IF TYPE ('THISFORM.wlHTMLgen') == 'L' AND m.THISFORM.wlHTMLgen = .T.
RETURN .F. && Deactivation in WEB mode
ENDIF
* Management of the ChampWhen and ChampSaisi properties on the server side
WITH m.THIS
.champsaisi = .F.
.champwhen = NULL
ENDWITH
ENDPROC
- 3.2.c Deactivation of the Input () simulation in WEB mode of the VFP object.InterActiveChange () event:
PROCEDURE object.Interactivechange
LPARAMETERS Useless_Parm
IF TYPE ('THISFORM.wlHTMLgen') == 'L' AND m.THISFORM.wlHTMLgen = .T.
RETURN .F. && Deactivation in WEB mode
ENDIF
* Management of the FieldSet property on the server side
THIS.champsaisi = .T.
ENDPROC
- 3.2.d Deactivation of the simulation in WEB mode of the VFP form.KeyPreview () event:
PROCEDURE keypreview
LPARAMETERS nKeyCode, nShiftAltCtrl
IF TYPE('THISFORM.wlHTMLgen') == 'L' AND m.THISFORM.wlHTMLgen = .T.
RETURN .F. && Deactivation in mode WEB
ENDIF
* Processing of keyboard keys on the server side
DO CASE
*F8 -7
CASE m.nKeyCode = -7
=THISFORM.btn_imp.CLICK()
*ESC 27
CASE m.nKeyCode = 27
=THISFORM.btn_exit.CLICK()
ENDCASE
ENDPROC
3.3 For the VFP Grid object:
3.3.a Deactivation of the 'BLUR' event in WEB mode reproducing the VFP events grid.AftertRowColChange () / grid.wAfterRowChange ():
PROCEDURE object.wAfterRowChange
LPARAMETERS tuRow
IF TYPE ('THISFORM.wlHTMLgen') == 'L' AND m.THISFORM.wlHTMLgen = .T.
RETURN .F. && Deactivation in WEB mode
ENDIF
* Processing record change in the server-side grid
RETURN DODEFAULT (@ m.tuRow)
ENDPROC
**4 Limitation of the quantity of data to be processed by a form: **
- In the application, the use of grids has been reviewed. Cursors / tables / aliases have been redesigned to present only a few dozen records to display instead of several hundred or even several thousand records
5 Replacement of Foxpro objects / functions:
- In my application it is essentially the replacement of a form simulating a calendar by the HTML / JQuery / Calendar function
Conclusion:
FoxInCloud knows how to evolve our applications over time by giving them a second wind!
**Since these changes, BioSIL has - a reduction of more than 30% of requests sent to the server, i.e. more than 14,000 fewer requests per day - a much more user-friendly and dynamic user interface **
In total, every day and for each user, 15 minutes less unnecessary waiting!

Thank you Gilles,
For sharing your experience and your optimization recipes.
Personally I find that there is too little discussions on the forum between users.
Likewise, it could be interesting to come together to finance developments such as those related to the connector, FontAwesome, Bootstrap ...
Bien à toi,
Vincent
Excellent tips Gilles. Thanks for sharing, I will study them.
Hi Gilles,
Thanks for putting together this experience feedback.
I'm glad to see your FoxinCloud app. growing while running smoothly.
Would be nice if you could also share some data regarding your app's availability (SLA).

Hi Vincent,
Personally I find that there is too little discussions on the forum between users.
Agreed!
Thanks for this suggestion!
FoxInCloud has thousands of users and very few dare share their experience with other users.
Maybe more discussion among experienced users could help…