Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

REST Performance & Keep Alives

marccawood
Participant

We consume REST web services from SAP ABAP (cl_http_client) but are seeing performance issues when very many requests need to be performed.

We imagine part of the overhead is the need to build a new connection to the remote host for each request. Is there any way to reuse connections using the "Keep Alive" features of HTTP 1.1 from ABAP?

Methods used:

  • cl_http_client=>create_by_destination()
  • cl_http_client=>create_by_url()
1 ACCEPTED SOLUTION

marccawood
Participant

OK, we solved the issue by simply using the same cl_http_client instance for multiple requests.

So basically:

1. Create cl_http_client object lo_client

2. Loop through multiple requests with lo_client->send( ).

3. Close connection with lo_client->close( ).

It's not yet clear if the headers need to be reset between each request.

6 REPLIES 6

NTeunckens
Active Contributor
0 Kudos

Can you check / verify with SAP-BASIS if they can / will use info in SAP-KBA's 824554 or 1757252 to check up on and / or modify connection Settings with regard to 'KeepAlive' and 'Timeouts'?

You might do(cument) some testing as to provide good arguments to make changes to this type of settings ...

0 Kudos

Thanks for the tip. Unfortunately it seems that the SICM settings for clients only apply to timeouts. The keep-alive settings (at least according to 824554) only apply to servers (i.e. SAP SICF services).

0 Kudos

See SAP Help on "icm/keep_alive_timeout" : link

See SAP Help mentioning ICM as HTTP-Client : link

SAP Wiki Timout options for ICM : link

marccawood
Participant

OK, we solved the issue by simply using the same cl_http_client instance for multiple requests.

So basically:

1. Create cl_http_client object lo_client

2. Loop through multiple requests with lo_client->send( ).

3. Close connection with lo_client->close( ).

It's not yet clear if the headers need to be reset between each request.

0 Kudos

Hi Marc

Glad you found some way to solve your problem (in part).

Please follow-up for all of us, if additional steps are necessary ...


Thanks

Nic T.

marccawood
Participant
0 Kudos

The parameter "icm/keep_alive_timeout" applies to ICM as a server. My question is related to outgoing requests where ICM is the client.

The parameters relevant seem to be:

  • icm/HTTP/client/keep_alive_timeout (default 10s docs)
  • icm/max_kept_client_conns (no documentation found)