Tomcat is unresponsive because the Redis thread pool hangs

Source: Internet
Author: User

Last week, a sudden error on the online server, the Tomcat service inexplicably unresponsive, view memory and CPU, everything is OK, view Nginx log, found that always return 499 error code, it appears that there is an error in the program, resulting in Tomcat hangs. There's no good way. After the thread, heap dump comes out, restart the Tomcat service and the app returns to normal.

After analyzing the dump heap, we found that there were more than 500 redis connections hanging there, looked at the configuration of the Redis connection pool, found a pool of up to 500, and then looked at the code carefully, found that there is a problem with the code logic, when the application passed in a key, get a value from Redis, If the key does not exist, the processing in the code is returned directly to NULL, without releasing the connection, so that the connection takes up space until the connection pool is full.

Tomcat is unresponsive because the Redis thread pool hangs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.