nginx - Regarding calling rest api, one third of the http requests failed and timed out.
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 17:20:58
0
2
548

The tomcat 8.0 server is used, nio mode. Others are default configurations.
Write an interface using rest of spring mvc, and then call it with resttemplate, through the connection pool implemented by httpclient. When 1,000 requests were made concurrently, some requests were found to have timed out. causing access failure. .

The entire system architecture is like this
There are three applications A, B, and C
C is responsible for operating the database, providing interfaces, and returning JSON
B is responsible for processing business, providing interfaces, returning JSON, and calling C's interface, save/read data
A is responsible for the front desk, calling B's interface
When A calls B, complex balancing is done through nginx, and there are two B servers.

Excuse me, what are the situations that may cause timeout?

过去多啦不再A梦
过去多啦不再A梦

reply all (2)
習慣沉默

B calls C to see if it is the database side.

    仅有的幸福

    First determine which step the problem is, and then analyze it in detail. You can print out the time consumption of each interface call

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!