API Performance Tuning

API Performance Tuning

Below are some of the metrics that need to consider while optimizing the performance of APIs/Services:
1) Response Time: Measures how quickly the APIs/Services are responding.
2) Payload and its size: Amount of data transported over the network.
3) Throughput: Number of times the APIs/Services are being invoked.

Some of the techniques which can help to improve those:
Caching
Compression - Compressing the contents before transporting them over the network avoids the latency at the network layer. Compressions like Brotli or GZip can be used to achieve this.
Payload Size - Sending only the needed data to the client reduces the network and other overheads in transporting the data to the client.
Logging - Avoid excessive logging of data to the log files, as this makes the server spend time on logging instead of spending time processing the request.
Optimizing the API/Service Code
To optimize the code at the server level:
- Caching frequently accessed contents on the server.
- Avoiding conversion of contents from one format to another.
- Fetch only the data needed from the database or from any other data source.
- Use connection pooling to connect to DB or any other data sources.
- Eager initialize the contents/objects/details that are needed for the application during the start-up in order to avoid the time spent on the initial requests.
- Avoid/reduce the synchronization area/block within the code.
- Configure proper timeouts to external/third-party calls to avoid thread waits.
Auto-Scaling
Settings

- Connection Pool
- Thread Pool
- Memory and GC
- Cache/Cache framework
- Auto-scaling
- Web server
- Other framework/third-party applications used in the application.

Comments

Popular posts from this blog

PL/SQL

JAVA8 Features

Build Automation