Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Help Center/ Distributed Cache Service/ User Guide (ME-Abu Dhabi Region)/ FAQs/ Client and Network Connection/ What Should I Do If an Error Is Returned When I Use the Jedis Connection Pool?

What Should I Do If an Error Is Returned When I Use the Jedis Connection Pool?

Updated on 2022-02-21 GMT+08:00

The error message that will possibly be displayed when you use the Jedis connection pool is as follows:

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

If this error message is displayed, check whether your instance is running properly. If it is running properly, perform the following checks:

  1. Network

    1. Check the IP address configurations.

      Check whether the IP address configured on the Jedis client is the same as the subnet address configured for your DCS instance.

    2. Test the network.

      Use the ping command and telnet on the client to test the network.

      • If the network cannot be pinged:

        For intra-VPC access, ensure that the client and your DCS instance belong to the same VPC and security group, or the security group of your DCS instance allows access through port 6379. For details, see Security Group Configurations.

      • If the IP address can be pinged but telnet failed, restart your instance. If the problem persists after the restart, contact the administrator.

  2. Check the number of connections.

    Check whether the number of established network connections exceeds the upper limit configured for the Jedis connection pool. If the number of established connections approaches the configured upper limit, restart the DCS service and check whether the problem persists. If the number of established connections is far below the upper limit, continue with the following checks.

    In Unix or Linux, run the following command to query the number of established network connections:

    netstat -an | grep 6379 | grep ESTABLISHED | wc -l

    In Windows, run the following command to query the number of established network connections:

    netstat -an | find "6379" | find "ESTABLISHED" /C

  3. Check the JedisPool code.

    If the number of established connections approaches the upper limit, determine whether the problem is caused by service concurrency or incorrect usage of JedisPool.

    When using JedisPool, you must call jedisPool.returnResource() or jedis.close() (recommended) to release the resources after you call jedisPool.getResource().

  4. Check the number of TIME_WAIT connections.

    Run the ss -s command to check whether there are too many TIME_WAIT connections on the client.

    If there are too many TIME_WAIT connections, modify the kernel parameters by running the /etc/sysctl.conf command as follows:

    ##Uses cookies to prevent some SYN flood attacks when the SYN waiting queue overflows.
    net.ipv4.tcp_syncookies = 1
    ##Reuses TIME_WAIT sockets for new TCP connections.
    net.ipv4.tcp_tw_reuse = 1
    ##Enables quick reclamation of TIME_WAIT sockets in TCP connections.
    net.ipv4.tcp_tw_recycle = 1
    ##Modifies the default timeout time of the system.
    net.ipv4.tcp_fin_timeout = 30

    After the modification, run the /sbin/sysctl -p command for the modification to take effect.

  5. If the problem persists after you perform the preceding checks, perform the following steps.

    Capture packets and send packet files along with the time and description of the exception to the administrator for analysis.

    Run the following command to capture packets:

    tcpdump -i eth0 tcp and port 6379 -n -nn -s 74 -w dump.pcap

    In Windows, you can also install the Wireshark tool to capture packets.

    NOTE:

    Replace the NIC name to the actual one.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback