Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Problems with Resin thread usage

Shulou Source: shulou.com Published: 2022-06-03 05:16:36 10月03日 Update

[Phenomenon]: The application response is slow and restarted by the monitoring script; the application load is low and the access pressure is small.

[Cause Analysis]:

1. Use netstat -na| wc -l View connections, connections are normal

2, use kill -3 PID, check the generated jvm_xxx.log, see what java is doing, see if it is normal

For example:

Cosmetics library, jvm LOG generated before the application is restarted by the monitored script has the following information

Statistics show that more than 230 threads are running this task;

Resin is configured with only 256 threads. This request takes up too many threads. Resin cannot process other requests, causing the request to timeout.

3. What are these requests and why are there so many of them? From the business view, we know that this request is an interface for the cosmetics library application to request quick search (using httpclient mode), and format the returned data and display it in the foreground.

4, Httpclient mode, each request needs to occupy a thread, when a request is completed after the thread will be reused, when the called system response is slow, it will lead to the call of its own application thread occupied too much, no resources to provide other services.

Solution:

Adjust the application to use httpclient method to call other resources, change to other methods or increase cache to reduce the number of calls.

Tags: Threads applications ways cosmetics scripts resources too much seeking truth makeup monitoring business tasks information foreground previous life methods stress causes cause analysis multiple Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Redmi Xiaomi Huawei