April 10, 2020 Blog FileMaker FileMaker 18 FileMaker Techniques User Interface Design cloud hostingCovid-19FileMaker Serverlatencylayoutoptimize solutionslow internetUI designwork from home 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 objectsNo images or auto-loading container fieldsLess conditional formattingFewer portal filters and rowsFewer rows in list viewsDifferent file startup proceduresFewer field fetches that cross multiple table occurrencesFewer 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. Latency_Check-1Download By Karl Jreijiri
5 Comments Richard Posted on 1:13 PM - April 18, 2020 Aloha, thanks this is great! I am using a pre FM12 solution and cannot open your file. Can you post the script or email to [Email address removed for privacy] Karl Jreijiri Posted on 8:18 AM - April 20, 2020 Thank you for your comment, Richard! I sent you an email with screenshots. I’m posting a part of the email that I sent you in case it’s relevant to other readers too: Get ( CurrentTimeUTCMilliseconds ) is not compatible with versions older than FM 13. You can use Get (CurrentTime) instead but it will give you results in fractions of a second if the latency result is smaller than a second. Get ( CurrentTimeUTCMilliseconds ) returns the time to the nearest millisecond which makes it a more accurate function for this script. Kent Searight Posted on 4:01 PM - April 29, 2020 Clever way to test latency! John Posted on 12:52 PM - July 14, 2020 This is a great tool! But.. I’m getting 0 ms result. Is this possible? John Posted on 12:54 PM - July 14, 2020 Oops. Should have read more. Problem was: “Get ( CurrentTimeUTCMilliseconds ) is not compatible with versions older than FM 13. You can use Get (CurrentTime) instead ” My apologies