cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Web services performance tuning in terms of concurrent users?

Former Member
0 Kudos

Hello,

we in our organisation are planning to build a web portal which can connect to our sap environment and perform various tasks.

Hence to find out the performance capabilities we exposed some web services from SAP end and did a load test on the same.

The test results were not promising, with only 25 concurrent users the response time was as high as 12 seconds.

Now we need to fine tune the SAP web service module to get the max performance.

Can anybody point us in the right direction?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

with only 25 concurrent users the response time was as high as 12 seconds

The main question is : what is the response time for a single call in an unloaded system ? 100 ms or 11 seconds ?

If there is a very big difference between a single test and load testing, check the configuration of the ICM, the web dispatcher if any, the locks from SM12.

Use STAD to see what the composition of the response time is.

In my experience, the response time of web services can be very good if the module functions called are good performance wise.

We have a Logistics ERP system where we can have a load of up to 50 web services calls per second with a response time around 200 ms. This system has 6 app servers and a web dispatcher for http load balancing.

Regards,

Olivier

Former Member
0 Kudos

A single call takes 1 to 1.5 secounds so may be there is a bottle neck in the function itself.

Will analyse the code and find out where its taking time.

Thanks

Former Member
0 Kudos

Hi,

You would need to provide a lot more information to get more relevant answers.

Some questions:

- Describe how you exposed the SAP webservices (i.e. standard Enterprise Services, Function Modules, custom...)

- How are you going your load tests (i.e. tools, service orchestration...)

- 25 concurrent user with multiple sessions each?

- Are you testing in a clustered environment with load balancing?

- Are you routing the call through SAP PI (or any other ESB) before it reaches the backend?

12 second response times are unacceptable but this could be related to many things, e.g. the server does not have sufficient memory, DB stat need to be run for the database, bad coding (or expensive SQL statements) for custom webservices etc...

Regards, Trevor

Former Member
0 Kudos

Thanks for answering

> - Describe how you exposed the SAP webservices (i.e. standard Enterprise Services, Function Modules, custom...)

Function modules were written and exposed as services

> - How are you going your load tests (i.e. tools, service orchestration...)

we wrote a java web application which in tern calls the web service using soap(stubs),this application was liad tested using Jmeter.

> - 25 concurrent user with multiple sessions each?

Does it matter and how? in our case yes.

> - Are you testing in a clustered environment with load balancing?

No

> - Are you routing the call through SAP PI (or any other ESB) before it reaches the backend?

No

>

> 12 second response times are unacceptable but this could be related to many things, e.g. the server does not have sufficient memory, DB stat need to be run for the database, bad coding (or expensive SQL statements) for custom webservices etc...

Edited by: SAPExplorer101 on Jul 6, 2011 1:17 PM

Former Member
0 Kudos

One of the function module code is as follows

FUNCTION ZHRPULSE_CREATECONTACTS3.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(EMPL_CONTACT_DETAILSIN) TYPE  ZHR_CONTACT_DETAILS
*"  EXPORTING
*"     VALUE(EMPL_CONTACT_DETAILSOUT) TYPE  ZHR_CONTACT_DETAILS
*"     VALUE(STATUS) TYPE  ZHR_STATUS
*"  TABLES
*"      SUBTYPE_TABLE STRUCTURE  ZHR_CONTACT
*"----------------------------------------------------------------------
DATA: tempRet type BAPIRETURN1,
      oref   TYPE REF TO cx_root.
DATA: E_IT0001 type P0001.


CALL FUNCTION 'HREIC_READ_INFOTYPE_0001'
  EXPORTING
    I_PERNR         = EMPL_CONTACT_DETAILSIN-EMPLOYEE_ID
    I_DATE          = sy-datum
 IMPORTING
    E_RETURN        = tempRet
    E_IT0001        = E_IT0001
 EXCEPTIONS
   NOT_FOUND       = 1
   OTHERS          = 2.

IF SY-SUBRC <> 0.
  Status-status = 'Failure'.
  status-information = 'ID Not Found in Master Data.'.
  exit.
ENDIF.
EMPL_CONTACT_DETAILSOUT-EMPLOYEE_ID = E_IT0001-PERNR.
EMPL_CONTACT_DETAILSOUT-EMPLOYEE_NAME = E_IT0001-ENAME.

SELECT single Btext from t001p into EMPL_CONTACT_DETAILSOUT-location where btrtl = E_IT0001-btrtl.

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
    EXPORTING
      NUMBER             = EMPL_CONTACT_DETAILSIN-Employee_ID.
  IF sy-subrc NE 0.
    Status-status = 'Failure'.
  status-information = 'NOT able to get a lock on the Employee ID'.
    EXIT.
  ENDIF.

  CALL FUNCTION 'BAPI_ADDRESSEMP_CREATE'
    EXPORTING
      EMPLOYEENUMBER         = EMPL_CONTACT_DETAILSIN-Employee_ID
      VALIDITYBEGIN          = SY-DATUM
      VALIDITYEND            = '99991231'
      ADDRESSTYPE            = '1'
      STREETANDHOUSENO       = EMPL_CONTACT_DETAILSIN-ADDRESS1
      SCNDADDRESSLINE        = EMPL_CONTACT_DETAILSIN-ADDRESS2
      CITY                   = EMPL_CONTACT_DETAILSIN-CITY
      POSTALCODECITY         = EMPL_CONTACT_DETAILSIN-PIN_CODE
   IMPORTING
      RETURN                 = tempRet
      EMPLOYEENUMBER         = EMPL_CONTACT_DETAILSIN-Employee_ID
            .

If sy-subrc eq 0.
  Status-status = 'Success'.
  status-information = 'Executed successfully'.
else.
  Status-status = 'Failure'.
  status-information = tempRet-message.
  exit.
endif.

"For creating communication details
subtype_table-subtype = '9100'.
subtype_table-communicationid = EMPL_CONTACT_DETAILSIN-EXTENTION.
append subtype_table.
subtype_table-subtype = '9200'.
subtype_table-communicationid = EMPL_CONTACT_DETAILSIN-EMERGENCY_NO.
append subtype_table.
subtype_table-subtype = '9300'.
subtype_table-communicationid = EMPL_CONTACT_DETAILSIN-AVAYA.
append subtype_table.
subtype_table-subtype = '9400'.
subtype_table-communicationid = EMPL_CONTACT_DETAILSIN-MOBILE_NO1.
append subtype_table.
subtype_table-subtype = '9450'.
subtype_table-communicationid = EMPL_CONTACT_DETAILSIN-MOBILE_NO2.
append subtype_table.
subtype_table-subtype = '9500'.
subtype_table-communicationid = EMPL_CONTACT_DETAILSIN-DIRECT.
append subtype_table.
subtype_table-subtype = '9600'.
subtype_table-communicationid = EMPL_CONTACT_DETAILSIN-HOME.
append subtype_table.

if subtype_table[] is not initial.

Loop at subtype_table.

  CALL FUNCTION 'BAPI_EMPLCOMM_CREATE'
    EXPORTING
      employeenumber        = EMPL_CONTACT_DETAILSIN-Employee_ID
      subtype               = subtype_table-SUBTYPE
      validitybegin         = sy-datum
      validityend           = '99991231'
      communicationid       = subtype_table-communicationid
   IMPORTING
      return                = tempRet
      .
 If sy-subrc eq 0.
  Status-status = 'Success'.
  status-information = 'Executed successfully'.
else.
  Status-status = 'Failure'.
  status-information = tempRet-message.
  exit.
endif.
  Endloop.
  CLEAR subtype_table.
ENDIF.

 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
          .
  "for unlocking the employee ID
  CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
    EXPORTING
      number = EMPL_CONTACT_DETAILSIN-Employee_ID
 "   IMPORTING
  "    return =
.
EMPL_CONTACT_DETAILSOUT-ADDRESS1 = EMPL_CONTACT_DETAILSIN-ADDRESS1.
EMPL_CONTACT_DETAILSOUT-ADDRESS2 = EMPL_CONTACT_DETAILSIN-ADDRESS2.
EMPL_CONTACT_DETAILSOUT-CITY = EMPL_CONTACT_DETAILSIN-CITY.
EMPL_CONTACT_DETAILSOUT-PIN_CODE = EMPL_CONTACT_DETAILSIN-PIN_CODE.
EMPL_CONTACT_DETAILSOUT-EXTENTION = EMPL_CONTACT_DETAILSIN-EXTENTION.
EMPL_CONTACT_DETAILSOUT-EMERGENCY_NO = EMPL_CONTACT_DETAILSIN-EMERGENCY_NO.
EMPL_CONTACT_DETAILSOUT-AVAYA = EMPL_CONTACT_DETAILSIN-AVAYA.
EMPL_CONTACT_DETAILSOUT-MOBILE_NO1 = EMPL_CONTACT_DETAILSIN-MOBILE_NO1.
EMPL_CONTACT_DETAILSOUT-MOBILE_NO2 = EMPL_CONTACT_DETAILSIN-MOBILE_NO2.
EMPL_CONTACT_DETAILSOUT-DIRECT = EMPL_CONTACT_DETAILSIN-DIRECT.
EMPL_CONTACT_DETAILSOUT-HOME = EMPL_CONTACT_DETAILSIN-HOME.

ENDFUNCTION.

Former Member
0 Kudos

Hi,

Maybe do some reading up on the SAP Code Inspector to analyze your code, a starting point:

[http://help.sap.com/saphelp_nw2004s/helpdata/en/56/fd3b87d203064aa925256ff88d931b/frameset.htm]

You might also need to check the Java (calling) code for performance. Also, don't write-off network performance.

Concurrent users with mutiple sessions makes a difference because each http call spawns stuff on the SAP application server

Regards, Trevor

Former Member
0 Kudos

I will go thru the same.

Thanks Trevor

Former Member
0 Kudos

Analyzed the code and was able to optimize too,now a single call takes ~1 sec(on sap side) and ~1.3 sec(on web service side) ,May be on a production server the response time will decrease further...

Mean while Web Service calls are taking 10 seconds instead of 12 for 25 concurrent users,which has improved but still very high..

Will using a java connecter and an external app server exposing the web service improve the results??

Went thru [http://www.info-sun.com/docs/wp_sapio.pdf|http://www.info-sun.com/docs/wp_sapio.pdf] and found that having an outside in approach will result in more control as well as performance..

Please confirm.

Former Member
0 Kudos

Hi,

You need to explain the java connector suggestion & in what context you will use it within your scenario, I don't understand how this will add benefit.

I just glanced over the document you've referenced, it looks really outdated, maybe try digging up some more up-to-date documentation on your scenario.

Regarding the external app server (I'm assuming you would have external people accessing this portal):

You would normally have a web server unstalled in your DMZ to handle or mashall incoming traffic into your network. Depending on how your production environment is setup, you may have multiple SAP instances with a SAP Web Dispatcher which is used for load balancing. This would significantly improve performance but if you start adding factors such as SSL encryption & decryption (which you more than likely would need to look at because of external access) then your latency per call increases substantially.

Some people even use the SAP Web Dispatcher in the DMZ to act as a traffic marshall & load balancer all -in-one. It's a balancing act between performance and adequate security.

Regarding the

Former Member
0 Kudos

Currently i was trying to access web services exposed directly by SAP,which by the way is not performing as expected(i understand that with further tweeking and optimization it can be improved but then again the load on the sap system will increase)

So what i am trying to do is use java connectors to access the BAPI's and delegate the work of web services,threads,concurrency to a J2ee application deployed on an App server.

In terms of BAPI calls by RFC(Java connector),how well can they handle concurrent calls?

Former Member
0 Kudos

RFC calls to a BAPI will handle concurrent calls easily. I've also seen some performance blogs here on SDN indicating that this approach would yield a reduced latency.

The bigger question would be, would adding an additonal J2EE hop (even with multi-threading) to the equation reduce latency or increase it. My guess would be that your response time would be slightly longer but that's just a guess. Maybe solicit some feedback from other's in these forums for a more well rounded answer. Or just try it & see if it works out better.

Regards, Trevor

Former Member
0 Kudos

Hello Again,

I implemented RFC java connectors(only java connector) and tested it,the results are same :(...

Hence the problem is at the SAP end only(code,Hardware,Database etc).

The one thing which i forgot to mention in the earlier post is that the operation is of type create and update and i saw in some posts that inherently create/update processes will be slow in SAP in terms of concurrency(due to locking and unlocking).

Can you please shed some light on the above statement?

Thanks Again

Vijay

Former Member
0 Kudos

Hi,

This makes sense, if look at it from an update perspective and you have two users trying to update the same record. There would have to be some lock - update - release lock mechanism to ensure data integrity.

Aspects like idempotency (duplicate) checks would apply during record creation functions.

As to how much latency is negatively impacted with these additional steps, that's debateable...

Regards