JChem Microservices FAQ and Known Issues¶
- FAQ
- Is there a maximum number of concurrent requests to API endpoints that it can handle?
- What is the suggested number of items per request for endpoints that take an array as an input?
- What is the storage backend behind JChem Microservices DB?
- How can I access the h2 storage backend behind JChem Microservices DB?
- How to add authentication to JChem Microservices?
FAQ¶
Is there a maximum number of concurrent requests to API endpoints that it can handle¶
Yes there is. What is this number? It depends.
If a specific service (like calculations service),
is used in standalone web application mode, then we expose it to Tomcat without any alteration.
Tomcat by default allows 200 concurrent (worker) threads.
(Can be changed by server.tomcat.threads.max property. Be aware it also has
a maximum number for accepted connections which is 8192, and can be changed by
server.tomcat.max-connections property.) But this is also influenced by the
OS settings and the available memory. (A process can not sprout endless threads.)
If the service is used in microservices system mode then our gateway service have
hystrix circuit breaker installed which only allows 10 running threads and 90 waiting requests.
These of course can be configured. For configuration detail please find our
documentation or the hystrix's documentation.
It is generally better to scale up the waiting requests rather than active ones
since too many active tasks can cause throttling. If they have to scale,
it is better to scale out the number of executing nodes and load balance the requests.
What is the suggested number of items per request for endpoints that take an array as an input¶
If the client runs a service in production for many users he is better off with
many small requests than few huge ones.
If the service is for a very few (even one) individual then few huge requests
(with many structures) can have a performance benefit. It must be told:
after a certain size the performance gain will be negligible.
The number of ideal structures are also influenced by the requested method,
and the "size" of the structures (and even the size of the structure representation,
a.k.a. the chemical format). As a general rule of thumb I can say:
requests should not take longer than 1 seconds. 1-2000 molecules can be a good
number for that (but it depends). If a request takes more than 1 second it is
more costly to experience any kind of error and it also limits the number of
concurrent requests. In one second the total communication cost is less than
1% of the whole process, if you move beyond that it is meaningless.
What is the storage backend behind JChem Microservices DB¶
It is configurable. The default configuration using
h2 db, but you can change it to
PostgreSQL as well. See configuration
details here.
Access h2 DB backend behind JChem Microservices DB¶
If your JChem Microservices DB configuration is using h2 backend, then it is
possible to configure the service to access the embedded h2 db console.
You need to add the following lines to
application.properties file:
After restarting the service the database console is available at
the localhost's 8062 port. http://localhost:8062/h2
Logging parameters are configured in the application.properties file. The default values are:
| Name | property name | value |
|---|---|---|
| JDBC URL: | com.chemaxon.zetor.settings.gcrdb.jdbcUrl | jdbc:h2:nio:./data/chemical-data/store/db |
| User Name: | com.chemaxon.zetor.settings.gcrdb.user | user |
| Password: | com.chemaxon.zetor.settings.gcrdb.password | password |
How to add authentication to JChem Microservices?¶
It is supported through external beans with introduction of a new logic (filter, endpoint, filter, logging, health check, etc.).
An example is available here.
Known Issues¶
MarvinJS cannot be used with JChem Microservices backend¶
Since JChem Microservices separated the services based on functionalities,
different modules provide the endpoints needed for MarvinJS frontend.
These modifications are not yet followed at frontend part,
so until then we suggest to use Marvin JS Web Services backend.
False similarity search results in the case of molecule types with tautomerHandlingMode=GENERIC parameter¶
In the case molecule types with tautomerHandlingMode=GENERIC parameter, similarity search gives false results.
These is no workaround at the moment, please do not execute similarity search in table having molecule type with com.chemaxon.zetor.types[n].tautomerHandlingMode=GENERIC parameter specified in the application.properties file.
From version 21.9.0 similarity search works correctly even in the case of molecule types with tautomerHandlingMode=GENERIC parameter.
Additional parameters do not work in gcrdb scheme in version 21.2.0 and 21.3.0¶
If the default schema gcrdb is set in the application.properties file, the additional parameters - taken from JChem Engines cache and memory calculator like com.chemaxon.zetor.settings.molecule.cachedObjectCount are not taken into account. If you want to set these additional parameters, please set com.chemaxon.zetor.settings.scheme= mapdb