SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
251 stars 73 forks source link

BAPI_PO_GETDETAIL1 call takes 15 seconds! #28

Closed doronoded closed 6 years ago

doronoded commented 7 years ago

Calling the BAPI_PO_GETDETAIL1 using the node-rfc lib takes about 15 seconds to run. I ran a system trace (ST05) which is attached, and saw that most of the "heavy lifting" is done in entries like this:

13:41:35.739 218.371 SAPLSYST DESKTOP-I432GMN Server 0 0 0 DESKTOP-I432GMN erpides_IDS_00 Server RFC_GET_FUNCTION_INTERFACE 2180 394

It seems the node-rfc library calls a lot of descriptor functions to describe the requested function's API. Is this true? Is this needed? Can this be optimized?

1.txt

bsrdjan commented 7 years ago

A little bit longer response time is expected for the first call but 15 seconds is too slow.

The node-rfc is a nodejs wrapper around SAP NW RFC SDK library and when the first RFC call is invoked, the RFC metadata descriptors are retrieved and cached by the library, without the node-rfc influence. The descriptors are needed for a proper mapping btw. nodejs data structures and RFC ABAP data container, used internally in RFC protocol.

I tested BAPI_PO_GETDETAIL1 and more complex BAPIs and noticed a couple of seconds lag sometimes, when the first call is invoked. It was never so slow, to disturb the user and require deeper investigation, never 15 seconds or something I felt necessary to measure. After that, the descriptors are internally cached and overhead should not happen anymore, during the lifecycle of the node-rfc instance.

Another reason for the slow first RFC call, could be the compilation of DDIC elements. You might experienced that opening a transaction may be very slow first time, after backend updates and upgrades. The reason is compilation (re-generation) of DDIC data elements, that must be executed after updates. If not done, the DDIC regeneration can start after opening the transaction or making the RFC call, for the first time after the update. Could it eventually be the case in your system ?

I suppose the the issue does not happen in a second call, with the same node-rfc instance, when metadata cached ?

Can you repeat the issue, does it get any better after restarting the client ?

Which SAP NW RFC SDK release are you using?

bsrdjan commented 7 years ago

Just tested, by extending a "Complex RFCs" unit test case, by BAPI_PO_GETDETAIL1.

The response times are btw. 1300 and 1500 ms, for the first call, just as orientation.

doronoded commented 7 years ago

Hi @bsrdjan, Thank you very much! You are right, there is a tremendous difference in performance between first and second run. First run still takes us 14-15 seconds, and the next run takes about 1s. We are using this SAP SDK version: NWRFC_42-20004568.SAR.

This is much better, although it is still kind of weird that the first run takes so long to complete.

bsrdjan commented 7 years ago

I tested on Linux but you are using Windows, right?

Could you please check if the same issue happens also with some other complex RFC, like BAPI_USER_GET_DETAIL for example?

doronoded commented 7 years ago

Checked. Took 22 seconds for the first run.. :(

bsrdjan commented 7 years ago

Is it a customer test system and can the access be arranged, to check directly in the system?

Could you please share your test script?

doronoded commented 7 years ago

Its our system. Yes, access can be arranged. If I run the bapi in SE37 in SAP gui, the result is instant. Less than 1s.

בתאריך 7 ביולי 2017 11:57,‏ "Srdjan Boskovic" notifications@github.com כתב:

Is it a customer test system and can the access be arranged, to check directly in the system?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SAP/node-rfc/issues/28#issuecomment-313627160, or mute the thread https://github.com/notifications/unsubscribe-auth/ADP71QLjH2zPQIAB06UX32hROOXwckayks5sLfMTgaJpZM4OBA6e .

bsrdjan commented 7 years ago

Could you please send me further details on srdjan.boskovic@sap.com, like the customer name, and backend release? Please attach the test script, that I can try on a similar test instance here.

doronoded commented 7 years ago

Hi, send you an email.

bsrdjan commented 6 years ago

Could not reproduce.