Detecting Connection Latency

Have you experienced slow response times on your cloud-hosted FileMaker solution? Organizations typically combat this by optimizing flows, scripts and layouts, which requires a lot of time to test, refactor and redesign. A faster way to combat this issue is to create layouts designed for users with slow internet connections. Here is a quick and easy method to detect high-latency users in FileMaker without using a plugin.

Latency in FileMaker is the round-trip time between FileMaker client and its server.

Sequence diagram made with Mermaid
Example of a high latency connection

Deploying the latency measurement script

These 3 script steps run in a loop

Get (UserCount) calls the FileMaker server to get the number of clients currently accessing the file. Other host-related functions fetch values from a local cache. In the example above, I’m measuring the time it takes for the Get (UserCount) function to fetch a value from the server multiple times, then looking at the average of those results. Comparing this technique with the operating system’s ping consistently returned similar results in my tests.

You can copy the script in the demo file below and paste it into your solution. Its script result is a number that indicates the user’s latency in milliseconds. Feel free to disable the custom dialog script step before deploying.

Script documentation is included in the demo file

Redirect users with high latency to minimal layouts

After deploying the script, I recommend designing minimal layouts for users who have a latency result higher than 350 ms. In other words, create distinct layouts for high latency users.

Minimal layouts differ from standard layouts because they contain:

  • Fewer layout objects
  • No images or auto-loading container fields
  • Less conditional formatting
  • Fewer portal filters and rows
  • Fewer rows in list views
  • Different file startup procedures
  • Fewer field fetches that cross multiple table occurrences
  • Fewer sorting levels, or no sorting

Ideally, defer loading of objects, fields and records until they are needed. Here’s how to get rid of sorted relationships.

Final notes

Optimizing FileMaker databases for the cloud is very complex, and there aren’t any silver bullets for optimizing speed. Measuring the latency of FileMaker users is a fast way to adapt to increased connection latencies that arise from slow internet, which can be especially prevalent with many users working from home. If you would like assistance in creating layouts for high latency users, or optimizing your database, email sales@app.works to schedule time for discussion.