REST API is working slowly

Hello,

When sending a request to the POST entity search API, the response comes in 20-25 seconds. I wrote a fetch plan and set the limit to 10. Even so, it is coming very slowly.

Thanks

I’d recommend to set up SQL logging and check the database request execution time.
See Logging SQL Statements.

Hello @krivopustov

2024-11-08T18:32:51.188+05:00 DEBUG 33228 — [nio-8080-exec-3] eclipselink.logging.sql : <t 1440516949, conn 186875894> [2 ms] spent

It didn’t take long to do it, but when I send a request through postman, as soon as I click send, this log appears, but it takes 10-15 seconds for the information to arrive to postman

I have written a fetch plan and even if I set the limit to 10 it is still slow

Have you tried to execute simple requests to a short list of entities?
How complex is your fetch plan?

@krivopustov

Short list entity is working fast in the server.

Slow entity fetch plan:

 <fetchPlan name="employee-list-mobile" entity="jb_Employee" extends="_instance_name">
        <property name="photo"/>
        <property name="staffingTables" fetchPlan="_instance_name">
            <property name="department" fetchPlan="_instance_name">
                <property name="parent" fetchPlan="_instance_name">
                    <property name="type"/>
                </property>
                <property name="type"/>
            </property>
        </property>
        <property name="phone"/>
        <property name="email"/>
        <property name="position" fetchPlan="_instance_name"/>
    </fetchPlan>

When I use this thing locally it works fast. But for some reason the server is very slow. Server RAM is 16 GB, CPU 8

What Jmix version are you using?
Can you estimate the size of loaded data that is being transmitted over the network?

Jmix version: 2.3.3
Data size to be loaded is 100. I do a limit of 10 and it runs slow

I mean data size in bytes.
The object graph loaded together with 10 root entities can be huge. Did you check this?