SageCRM Rest API - responses are slow

SUGGESTED

We use the Rest API of SageCRM to get data and update data. The performance of the Rest API is poor: a general get of one Person takes 500 ms. Is this the normal response time you can expect from the SageCRM Rest API?

Do you have any suggestions to speed things up?

  • 0
    SUGGESTED

    Hi Bas

    My immediate expectation is that if you are experiencing poor performance with the REST API you are also likely to be facing performance issues across the whole implementation.

    Your question peak my curiosity and so I just run a couple queries against a test application on a fairly underpowered server.

    I tested the main UI response time to retrieve company details.

    http://{server}/{install}/eware.dll/Do?SID={SID}&Act=200&Mode=1&CLk=T&Key0=1&Key1=28&T=Company

    Request Count: 1
    Bytes Sent: 1,162 (headers:1,162; body:0)
    Bytes Received: 1,777 (headers:273; body:1,504)

    --------------
    Overall Elapsed: 0:00:00.036

    I have excluded all the other additional asynchronous requests that the page makes such as the fetch of the notification.  So the base 'get' took 36ms.

    I then tested the equivalent REST 'get' to retrieve a company record.

    http://{server}/sdata/{install}j/sagecrm2/-/company('28')

    Request Count: 1
    Bytes Sent: 335 (headers:335; body:0)
    Bytes Received: 2,502 (headers:403; body:2,099)
    --------------
    Overall Elapsed: 0:00:00.311

     So the REST API fetch of a company record took 31ms and the main UI equivalent took 36ms.  I would expect that if I was using the recommended hardware and memory on the server I would shave time off both queries.  Sage CRM is generally a database 'bound' application so I think if I tuned the server then I could expect even better results.

    I only tested the 'get' but when updating data do make sure that you use the parameter 'returnPartial=false'.  See (+) Ensuring best performance using the REST API - Sage CRM Hints, Tips and Tricks - Sage CRM - Sage City Community

    Have a look as improving the overall performance of your implementation of Sage CRM and ensure that it has tuned database with adequate resources.

    I hope this helps. 

  • 0

    Dear 'Sage CRM', thanks for your suggestions.

    I executed the tests you suggested.

    The UI response was 187 kB in 461 ms

    The sdata response was 6 kB in 548 ms

    Can there be a general performance issue?

  • 0 in reply to Bas van Engelen

    It's difficult to be certain but I suspect that there are general environmental improvements can be made.  When a disk starts to get full, files can be fragmented, slowing website performance.   What is the free disk space like?  Are you logging levels set high?  Does your database run on the same machine as the webserver? 

    The REST request is a lighter weight package sent to the server.  The request is then redirected from IIS to Apache Tomcat and then the webapp does the fetch from the database.    There is more data returned within the REST response but its structure is simple and within the UI then is more 'busy-ness' with multiple additional fetches of information to build the interface.    

  • 0 in reply to Sage CRM

    Sage CRM: just to make sure...

    In above post you indicate:
    UI: Overall Elapsed: 0:00:00.036
    Rest API: Overall Elapsed: 0:00:00.311

    Then in your comment: "the REST API fetch of a company record took 31ms and the main UI equivalent took 36ms".
    What is correct: Rest API 311 ms or 31 ms?

    Our situation:
    Application and database on same server, ample free disk space available, logging: system logging level 5, SQL logging level: only errors, .NET logging off.
    Tests are preformed on the server itself.