N
N
Nastya19202020-06-22 06:08:14
Java
Nastya1920, 2020-06-22 06:08:14

How to speed up a complex rest api method?

The methods that my RestController calls contain complex logic: 3-4 internal requests to other services. Even during testing, it works very slowly.
1. Do I need to additionally implement some code for multithreading (as far as I know, Tomcat and Spring itself assume their own pools in their algorithms. That is, threads from 100-200 clients, in theory, are executed in parallel and do not, of course, wait for each other, the rest are cut off by a timeout.But how does it work with requests inside the method? Is it there?)
2. If additional code for multithreading is not needed here, then how to speed up the process? (For example, the logic is:
Publish the post, where the server should get a location in Googlemaps, send a photo to get tags, save it to its database, send the card for conversion to another server, and after returning, put it in another database on another server).
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question