Linux System log __ratelimit:n callbacks suppressed

Source: Internet
Author: User
Tags fpm syslog system log


Error


Today, the line encountered a fault, PHP because of the paragraph error exited, the system log kernel error is as follows:




Feb 25 22:25:11 web_server_01 kernel: __ratelimit: 250 callbacks suppressed
Feb 25 22:25:11 web_server_01 kernel: php-fpm[25942]: segfault at 2c6 ip 00000000000002c6 sp 00007fffdcf9e798 error 14 in php-fpm[400000+a3b000] 
Inquire


For __ratelimit:250 callbacks suppressed the cause of the error is not very understanding, then made a query, record:



__ratelimit:n callbacks suppressed indicates that the kernel blocks N syslog messages because the system repeats too many logs (too often), outputs too quickly, and the syslog message is limited by the Net_ratelimit () in the kernel.



Source Code Reference: http://fxr.watson.org/fxr/source/lib/ratelimit.c?v=linux-2.6



This rate limit is also a mechanism for Linux to avoid Dos attacks, preventing each message from being logged (which can cause a burst of storage space). When the kernel logs messages, use PRINTK () to check whether the log is output.
This restriction can be tuned by/proc/sys/kernel/printk_ratelimit and/proc/sys/kernel/printk_ratelimit_burst. The default configuration (RHEL6) is 5 and 10, respectively. In other words, the kernel allows 10 messages to be logged every 5 seconds. Beyond this limit, the kernel discards the log and logs Ratelimit N:callbacks suppressed.




[[email protected]_server_01 ~]#  cat /proc/sys/kernel/printk_ratelimit
5
[[email protected]_server_01 ~]#  cat /proc/sys/kernel/printk_ratelimit_burst
10
[[email protected]_server_01 ~]# 


However, the kernel's network code has its own limited configuration (logically identical, but independent)/proc/sys/net/core/message_cost and/proc/sys/net/core/message_burst, and the default configuration is also 5 and 10. Here Message_cost is also the log sampling time.




[[email protected]_server_01 ~]# cat /proc/sys/net/core/message_cost
5
[[email protected]_server_01 ~]# cat /proc/sys/net/core/message_burst
10
[[email protected]_server_01 ~]#


If you want to turn off the ratelimit mechanism, which is to allow each message to be logged, you can set the Message_cost value to 0



Sysctl-w net.core.message_cost=0


However, once Ratelimit is turned off, there is a risk that the system will be attacked by logs.






Reference Link: https://huataihuang.gitbooks.io/cloud-atlas/content/os/linux/kernel/log/ratelimit.html



Linux System log __ratelimit:n callbacks suppressed


Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

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.