Delay when fetching data from headless-admin-user/v1.0/user-accounts for the first time after server restart

Issue

  • When running a REST API call as below:
    /o/headless-admin-user/v1.0/user-accounts/fields=id,familyName,givenName,jobTitle,organizationBriefs.name,image,emailAddress,profileURL,contactInformation.telephones.phoneNumber,contactInformation.telephones.phoneType,customFields&pageSize=1000
    Portal users and administrators may observe slowness after a server restart. The slowness will increase as the number of users to fetch will grow. After the first delay, subsequent fetch calls will be faster.

Environment

  • Liferay DXP 7.1+

Resolution

  • The observed behavior is intended, as Liferay clears the database cache after a server restart.

  • One approach to handle the issue is through a cache "warm-up" mechanism. To elaborate more, upon restarting the server:

    1. Setup a crawler or jmeter script that runs the concerned query / visits the page where the datatable portlet is present so the query runs.
    2. Once the server is restarted and while the traffic is not routed to the server (e.g.:  the load balancer does not send any traffic yet), run the script to visit the pages directly on the node.
    3. Enable traffic routing to the server.

  • Please note, the above method is untested and only provided as a hint. As it pertains to the domain of customizations, the ability of Liferay Support to assist with it is limited.
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています