Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

alt

Daniel Nashed

Domino autoupdate.nsf for fast internal software downloads

Daniel Nashed – 18 February 2024 10:59:11

Domino Autoupdate has been introduced in Domino 14.0. It offers automatic downloads from My HCLSoftware download, which has been on early access in parallel and has been released at the same time.


My Engage session will go into detail about the functionality with tips and tricks and additional information round both features and the new Domino Download script
(https://nashcom.github.io/domino-startscript/domdownload/).
But I want already provide some details about options available today with simple integrations.

Now that we have and internal repository centrally managed which can be also replicate to remote locations, it would make sense to leverage it for company internal downloads.
Each software document contains one attachment, which we would just need to located and generate a download link.

A download command could look like the following:



curl -LO -u user:password '
https://software.acme.com/software.nsf/download?OpenAgent&filePath=Domino_14.0_Linux_English.tar'


Simplified URL with Domino redirects


To simplify and hide the URL, a simple redirect rule could be added:


Image:User Domino autoupdate.nsf for fast internal software downloads


This would allow to download with this simplified URL.



curl -LO -u user:password
https://software.acme.com/software/Domino_14.0_Linux_English.tar

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                          Dload  Upload   Total   Spent    Left  Speed

 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 1068M  100 1068M    0     0   140M      0  0:00:07  0:00:07 --:--:--  152M




Domino 14.0 HTTP download performance improved for uncompressed attachments


The download rate in this example is real world performance between two Hetzner servers.
Both sides are connected with a fast network and have fast disks. At this speed not only the Domino server components are important.

Yes this is a Domino NSF based download using standard Domino HTTPS!

The AutoUpdate team did performance tests with those type of downloads via HTTP and found a bottleneck, which is fixed in Domino 14.0.

Performance of uncompressed attachment download has been dramatically improved.

The download of compressed attachments (LZ1 or Huffman) also improved, but not at the same scale because the back-end requires uncompressing buffering, which has impact on the HTTP download performance.


Best practice for Domino HTTP download performance


A best practice is to store attachments which need to be downloaed always uncompressed. Usually the attachment itself is already compressed.
What we also found out is that DAOS further improves HTTP download performance and attachment performance in general.




Example agent to find documents and generate a redirect


The agent just needs to parse the request, find the document and generate a redirect link with some simple print statements.

I plan to provide a simple "software.nsf database, which complements the functionality of autoupdate.nsf with functionality like this.
It would also provide a simple download link for software.jwt, which contains all the information about available software including the SHA256 checksum.



Option
Public
Option
Declare

Sub
Initialize
         
 
Dim session As New NotesSession
 
Dim db As NotesDatabase
 
Dim WebDoc As NotesDocument
 
Dim doc As NotesDocument

 
On Error GoTo error_handler
 
 
Set db = session.Currentdatabase
 
Set WebDoc = session.DocumentContext

 
If ("GET" = WebDoc.REQUEST_METHOD(0)) Then

         
Call  DownloadRedirect (WebDoc)

         
Exit Sub
 
End If

 
' Other requests are ignored
 
Exit Sub
 
error_handler:

 
Print "Content-type: text/plain"
 
Print ""
 
Print "Error processing request"
 
 
Exit Sub
 

End
Sub


Sub
DownloadRedirect (WebDoc As NotesDocument)
 
Dim KeyName As String        
 
Dim db As New NotesDatabase ("", "autoupdate.nsf")
 
Dim doc As NotesDocument
 
Dim count As Integer

 
On Error GoTo error_handler
 
 KeyName =
StrToken (StrToken (WebDoc.QUERY_STRING_DECODED(0), "&", 2), "=", 2)
 
 
If ("" = KeyName) Then
         
Call SendError ("Not Software specified")
         
Exit Sub
 
End If

 
Set Doc = GetDocByFormula (db, {(Form = "Software") & fileName = "} + KeyName + {"})

 
If (Doc Is Nothing) Then
         
Call SendError ("Software not found: " + KeyName)
         
Exit Sub
 
End If

 
If (doc.Status(0) <> "A") Then
         
Call SendError ("Software not available")
         
Exit Sub
 
End If

 
Print "Location: /" + db.Filepath + "/0/" + doc.Universalid + "/$File/" + KeyName
 
Print {Content-Disposition: attachment; filename="} +  KeyName + {"}
 
Print ""

 
Exit Sub
 
error_handler:

 LogError
"Software - Error: " + Error()
 
 
Exit Sub
 

End
Sub

Links

    Archives


    • [HCL Domino]
    • [Domino on Linux]
    • [Nash!Com]
    • [Daniel Nashed]