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
Help Center/ Elastic Cloud Server/ Troubleshooting/ Linux ECS Issues/ How Do I Troubleshoot "nf_conntrack:table full, dropping packet"?

How Do I Troubleshoot "nf_conntrack:table full, dropping packet"?

Updated on 2024-08-15 GMT+08:00

Symptom

A timeout error occurred when you accessed a website. You got a lot of log messages kernel nf_conntrack: table full, dropping packet in /var/log/messages.

Figure 1 System logs

Scenarios

The operations in this section only apply to CentOS with firewalls enabled.

Constraints

The operations in this section involve modifying kernel parameters at runtime, which may render kernel unstable, requiring system reboot.

Possible Cause

The connection-tracking module within iptables stores connections in the conntrack table. table full, dropping packet indicates that the table is full and new entries cannot be created for new connections. As a result, packet dropping occurs. This problem can be solved by increasing the number of allowed entries for tracked connections.

Solution for CentOS 6

  1. Run the following command to check the value of nf_conntrack_max:

    sysctl net.netfilter.nf_conntrack_max

  1. Run the following command to check the number of tracked connections:

    cat /proc/sys/net/netfilter/nf_conntrack_count

    If the value of nf_conntrack_max is reached, packet dropping occurs.

  2. Set a larger value for net.netfilter.nf_conntrack_max. The following uses an ECS with 64 GB of memory as an example and uses 2097152 as the value of net.netfilter.nf_conntrack_max.

    Run the following command for the configuration to take effect:

    sysctl -w net.netfilter.nf_conntrack_max=2097152

    Run the following command to ensure that the configurations are still valid after the ECS is restarted:

    echo "net.netfilter.nf_conntrack_max = 2097152" >> /etc/sysctl.conf

    NOTE:
    • Set .net.netfilter.nf_conntrack_max based on the memory size of an ECS.
    • Use the following rule to calculate an appropriate value for nf_conntrack_max:

      CONNTRACK_MAX = RAMSIZE (in bytes)/16384/2

      For an ECS running a 64-bit OS with 64 GB of memory, the most appropriate value for .net.netfilter.nf_conntrack_max is 2097152.

      CONNTRACK_MAX = 64 x 1024 x 1024 x 1024/16384/2 = 2097152

  3. If the number of entries in the conntrack table increases significantly, for example, by four times the number of tracked entries, increase the size of the hash table for storing conntrack entries.

    For CentOS 6 and later versions, calculate a new hash value using rule hashsize = conntrack_max/4.

  4. Run the following command to set the size of the hash table to 131072:

    echo "options nf_conntrack expect_hashsize=524288 hashsize=524288" >/etc/modprobe.conf

  5. Run the following command to restart iptables:

    service iptables restart

Solution for CentOS 7

  1. Run the following command to change the size of the hash table for conntrack connections in /etc/modprobe.d/firewalld-sysctls.conf:

    For CentOS 6 and later versions, calculate a new hash value using rule hashsize = conntrack_max/4.

    echo "options nf_conntrack expect_hashsize=131072 hashsize=131072" >> /etc/modprobe.d/firewalld-sysctls.conf

  1. Run the following command to restart firewalld:

    systemctl restart firewalld

  1. Run the following command to check whether the proceeding configurations have taken effect:

    sysctl -a |grep nf_conntrack_max

For more information, see Red Hat Customer Portal.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback