API Performance Suggestions

For requests or help with our API
Post Reply
rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

API Performance Suggestions

Post by rinse-dental » Wed Aug 17, 2022 7:01 pm

We're getting some suspect response times for simple APIs like Get Medications (700-1400 ms) and GetAllergies (500-900 ms), and much higher times for GetAppointments/Slots (1200-2000+ ms).

We'd love to see these sub-500ms. We're operating with the middle tier architecture with a VM on GCP. The VM/server is running Windows Server 2022 Datacenter. The machine is a e2-highmem-2 (2 vCPUs, 16 GiB memory), with SSD storage and on the 'Premium' network tier.

Please let me know if you have any suggestions.

SLeon
Posts: 476
Joined: Mon Mar 01, 2021 10:00 am

Re: API Performance Suggestions

Post by SLeon » Thu Aug 18, 2022 9:53 am

It sounds like you are using our Remote API (the api.opendental.com endpoint) mode. And while it has obvious advantages, this is our slowest API mode due to the sheer travel time. Additional layers like Middle Tier and a GCP VM could increase these times.

There are two other API modes that I would recommend, depending on your needs (See https://www.opendental.com/site/apilocal.html).

Local Mode - The Local API exists on the machine where OpenDental.exe is running, a typical workstation. When Open Dental is launched, it starts listening for on a specific port for API traffic. You would make API requests on that machine to "http://localhost...". The Local API can only listen for requests when Open Dental is running.

Service Mode - The API Service runs on the machine where your eConnector is installed. It also opens a specific port, but can accept requests from anywhere on its network, not just localhost. As long as the server is on, the API Service can process requests.

I just ran an Appointments GET for a dental office without middle tier as an example of request time differences:
Remote: 378ms
Local: 8ms
Service: 11ms

rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Performance Suggestions

Post by rinse-dental » Sat Aug 20, 2022 10:07 am

Thanks! I think service API is what I'm after, though... for whatever reason, I don't see an option to upgrade to the v22.2 beta. I'm currently running v22.1.54... when I 'check for updates' I get a 'connection successful. no downloads available' .

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: API Performance Suggestions

Post by allends » Tue Aug 23, 2022 9:06 am

You should be able to update to the beta now.
Please try again and let me know if you are still experiencing the issue.
Allen
Open Dental Software
http://www.opendental.com

rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Performance Suggestions

Post by rinse-dental » Tue Aug 23, 2022 5:19 pm

Got it, thank you

rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Performance Suggestions

Post by rinse-dental » Tue Aug 23, 2022 7:11 pm

Alright... re: Service API. Next issue. Unless I'm misunderstanding the instructions, the API service did not install automatically.
Screen Shot 2022-08-23 at 7.05.38 PM.png
Screen Shot 2022-08-23 at 7.05.38 PM.png (136.88 KiB) Viewed 3895 times


And, when I try to manually install the service, I get this error message.
Screen Shot 2022-08-23 at 7.06.02 PM.png
Screen Shot 2022-08-23 at 7.06.02 PM.png (121 KiB) Viewed 3895 times
I took a peak over at Windows Services Admin, I see the services lists in the first screen shot but not an Open Dental API service.

justine
Posts: 168
Joined: Tue Dec 28, 2021 7:59 am

Re: API Performance Suggestions

Post by justine » Wed Aug 24, 2022 8:22 am

Good morning rinse-dental.

All services must start with 'OpenDent...'. One of two things may be happening here. You may have installed the API service under the name 'OpenDent'. Typically, the Service Name would be called something like 'OpenDentalAPIService'. The documentation has been updated to make this clearer.

OpenDentalAPIService.jpg
OpenDentalAPIService.jpg (26.33 KiB) Viewed 3887 times
What happens when you double click your existing 'OpenDent' service? Does it say it's installed and running?

rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Performance Suggestions

Post by rinse-dental » Wed Aug 24, 2022 11:09 am

It doesn't appear the API service was installed, or if it is... OD isn't picking it up.

Here are the 3 services that were installed by default by Open Dental.
Screen Shot 2022-08-24 at 10.43.42 AM.png
Screen Shot 2022-08-24 at 10.43.42 AM.png (75.68 KiB) Viewed 3875 times
Screen Shot 2022-08-24 at 10.52.12 AM.png
Screen Shot 2022-08-24 at 10.52.12 AM.png (73.4 KiB) Viewed 3875 times
Screen Shot 2022-08-24 at 10.44.17 AM.png
Screen Shot 2022-08-24 at 10.44.17 AM.png (68.23 KiB) Viewed 3875 times
Here's the version I'm on.
Screen Shot 2022-08-24 at 10.45.33 AM.png
Screen Shot 2022-08-24 at 10.45.33 AM.png (54.54 KiB) Viewed 3875 times
Here are the services running.
Screen Shot 2022-08-24 at 10.45.58 AM.png
Screen Shot 2022-08-24 at 10.45.58 AM.png (135.24 KiB) Viewed 3875 times

rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Performance Suggestions

Post by rinse-dental » Wed Aug 24, 2022 11:24 am

Update.

I uninstalled 'OpenDent' (the econnector service)...then I installed the OpenDentalAPIService... then I reinstalled the econnector service and rebooted the server as instructed.

The good news... all 3 Open Dental services are installed
The bad news... the API Service is stopped and will not start, the service times out. below is the LOG. The other two services, including the econnector service is running. Port 30223 is open.

NOTE: we operate with two registration keys for OD, a DEV key and a PROD key. This is on the DEV server which is a built from a replica of our production server on GCP. I just noticed it shares the same computer name as our PROD server. That said, we use separate API keys and have been successfully using the hosted APIs for both DEV and PROD for the last several months.
08/24/22 18:15:39:738 Starting Open Dental API Service.
08/24/22 18:15:39:745 Initializing database.
08/24/22 18:15:39:935 Failure to initialize database. Connection name not found: DentalOffice
08/24/22 18:15:39:935 Stopping Open Dental API Service.

justine
Posts: 168
Joined: Tue Dec 28, 2021 7:59 am

Re: API Performance Suggestions

Post by justine » Wed Aug 24, 2022 1:03 pm

rinse-dental wrote:
Wed Aug 24, 2022 11:24 am
Update.

I uninstalled 'OpenDent' (the econnector service)...then I installed the OpenDentalAPIService... then I reinstalled the econnector service and rebooted the server as instructed.

The good news... all 3 Open Dental services are installed
The bad news... the API Service is stopped and will not start, the service times out. below is the LOG. The other two services, including the econnector service is running. Port 30223 is open.

NOTE: we operate with two registration keys for OD, a DEV key and a PROD key. This is on the DEV server which is a built from a replica of our production server on GCP. I just noticed it shares the same computer name as our PROD server. That said, we use separate API keys and have been successfully using the hosted APIs for both DEV and PROD for the last several months.
08/24/22 18:15:39:738 Starting Open Dental API Service.
08/24/22 18:15:39:745 Initializing database.
08/24/22 18:15:39:935 Failure to initialize database. Connection name not found: DentalOffice
08/24/22 18:15:39:935 Stopping Open Dental API Service.
Hello rinse-dental.

The log is indicating that you may be missing OpenDentalWebConfig.xml, or that OpenDentalWebConfig.xml is missing a node. This sometimes happens when the API Service is installed manually.

Navigate to where the eConnector's executable is located. (C:\Program Files (x86)\Open Dental\OpenDentalEConnector\) and find OpenDentalWebConfig.xml. Copy that xml file and paste it in the C:\Program Files (x86)\Open Dental\OpenDentalAPIService\ directory.
Within the OpenDentalAPIService folder, edit OpenDentalWebConfig.xml and add the following node below the <DatabaseType> node:

Code: Select all

<Note>DentalOffice</Note>
Save.

This is literally "DentalOffice" and not the name of your dental office.

rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Performance Suggestions

Post by rinse-dental » Wed Aug 24, 2022 4:06 pm

Thanks. The Service still does not start. See the steps I followed below.
  • Copy of WebConfig file from C:\Program Files (x86)\Open Dental\OpenDentalEConnector CHECK
  • Paste to C:\Program Files (x86)\Open Dental\OpenDentalAPIService CHECK
  • Add <Note>DentalOffice</Note> to the APIService OpenDentalWebConfig file CHECK
Screen Shot 2022-08-24 at 3.53.02 PM.png
Screen Shot 2022-08-24 at 3.53.02 PM.png (56.54 KiB) Viewed 3857 times
  • Restarted Server
From logger... Note that my webconfig uses a MySQLPassHash
08/24/22 22:51:34:054 Failure to initialize database. Authentication to host 'localhost' for user 'rinse_prod' using method 'mysql_native_password' failed with message: Access denied for user 'rinse_prod'@'localhost' (using password: NO)
08/24/22 22:51:34:054 Stopping Open Dental API Service.
I did attempt to add the MySQL password in the <password>, after doing so I got back to this log error.
8/24/22 23:00:59:492 Starting Open Dental API Service.
08/24/22 23:00:59:502 Initializing database.
08/24/22 23:00:59:757 Failure to initialize database. Connection name not found: DentalOffice
08/24/22 23:00:59:757 Stopping Open Dental API Service.
I also tried moving the <Note> below the </databaseconnection> tag. No change.

SLeon
Posts: 476
Joined: Mon Mar 01, 2021 10:00 am

Re: API Performance Suggestions

Post by SLeon » Thu Aug 25, 2022 9:46 am

Hey there, I am sorry you are having issues starting the API Service. Could you please confirm a few things?

- The API is enabled. Launch Open Dental with your DEV regkey, navigate to Setup > Advanced Setup > API, and verify that the Enabled box is checked. The OpenDentalAPIService will not automatically update if the API is not enabled for this regkey.
OD_Setup_AdvancedSetup_API_Enabled.gif
OD_Setup_AdvancedSetup_API_Enabled.gif (23.42 KiB) Viewed 3840 times

- The machine on which you are installing the API Service is the same machine you have installed the eConnector. Does this DEV eConnector successfully send API requests to our Remote API endpoints (api.opendental.com/...). If this is not a working/live eConnector, then it's config file is not suitable for directly copying over to the API Service.

- Does the information in your OpenDentalAPIService/OpenDentalWebConfig.xml look similar to below? Make sure that the ComputerName and Database nodes reflect your DEV environment. This information should look identical to the Choose Database window when you launch Open Dental with your DEV environment.
ChooseDatabase_ConfigFile.gif
ChooseDatabase_ConfigFile.gif (88.82 KiB) Viewed 3840 times

It worth noting that any changes made to the OpenDentalWebConfig file will be reflected the next time you Start the API Service. It is not necessary to Un/reinstall the OpenDentalAPIService.exe or restart the machine itself.

rinse-dental
Posts: 73
Joined: Wed Apr 06, 2022 12:04 pm

Re: API Performance Suggestions

Post by rinse-dental » Thu Aug 25, 2022 6:32 pm

API Enabled... confirmed.

eConnector service installed and API requests sending to Remote API endpoint, confirmed.

OpenDentalAPIService/OpenDentalWebConfig.xml looks similar to yours and matches exactly on the highlighted sections, confirmed.

Still not working. API service not starting, logging shows the same generic error.

SLeon
Posts: 476
Joined: Mon Mar 01, 2021 10:00 am

Re: API Performance Suggestions

Post by SLeon » Fri Aug 26, 2022 11:23 am

Thank you for confirming all these details for your DEV credentials. There are two different things you can try.

1. Uninstall the API Service and update to our latest beta version (prompt the auto-install of the API Service again)

We released a new beta version (22.2.31) last night. Remove your manually created config file and uninstall the API Service (not any other services). Then Launch Open Dental as Admin, choose your DEV database, and update as usual. Services should never be installed via the Middle Tier. When update process automatically closes Open Dental, be sure to run it again as Admin and choose your DEV database/credentials to finish the update. This will create a new config file that should work out of the box.

2. You wrote "generic error message", do you mean "Connection name not found: DentalOffice"?

If so, there are three main things that can cause this: the MySQL password is incorrect, the Password and MySQLPassHash nodes do not resolve to the same string, or if the organization of the config file's nodes are incorrect in any way. The screenshot you included earlier with the red arrow shows the Note node in the correct position.

Post Reply