关于页面502的一次排查,页面502排查
关于页面502的一次排查,页面502排查
一、场景: 系统 Deepin 15;php 5.5.33;nginx 1.9.9
二、状况: 简单的页面输出正常(比如 phpinfo();),跑公司的任何一个项目,均502
三、排查
1、查询各种日志,包括 nginx.error.log、php_error.log、php-fpm.error.log,找到php-fpm报错如下
[22-Mar-2016 11:06:32] WARNING: [pool www] child 3665 exited with code 127 after 24.657496<span> seconds from start [22-Mar-2016 11:06:32] NOTICE: [pool www] child 3676 started</span>
2、最开始以为是由php-fpm进程数不足引起,便对php-fpm.ini做出如下修改
(这一步和网上很多的解决方案相同,但是没有效果)
pm.max_children = 20<span> pm.start_servers = 10<span> pm.min_spare_servers = 10<span> pm.max_spare_servers = 20<span> pm.process_idle_timeout =<span> 10s pm.max_requests = 500</span></span></span></span></span>
3、经过大量查询,有说是Linux文件句柄数不足
(忘记保留url和改动的地方,经过一番折腾也没有效果)
4、回归 php-fpm.error.log,通过 exited with code 127 查到
(http://www.faqs.org/docs/abs/HTML/exitcodes.html)
5、基于上一步才想起用 strace 来跟踪 php-fpm进程,方法分两种
(其实这一步早该尝试,Rango http://rango.swoole.com/archives/340)
5.1、把php-fpm的进程数限制设置为1,然后直接 strace -p 123456 进行跟踪单个进程
5.2、直接使用下面的命令批量跟踪进程
ps -ef | grep fpm | awk '{print "-p " $2}' | xargs strace
由于出问题的是自己的机子,没有其他人访问,所以使用第二个方法进行跟踪,部分结果如下
[pid 6744] fstat(5, {st_mode=S_IFREG|0644, st_size=5016, ...}) = 0<span> [pid 6744] mmap(NULL, 5016, PROT_READ, MAP_SHARED, 5, 0) = 0x7f132588f000<span> [pid 6744] munmap(0x7f132588f000, 5016) = 0<span> [pid 6744] close(5) = 0<span> [pid 6744] writev(2, [{"php-fpm: pool www", 17}, {": ", 2}, {"symbol lookup error", 19}, {": ", 2}, {"/usr/local/php/lib/php/extension"..., 71}, {": ", 2}, {"undefined symbol: mmc_queue_pop", 31}, {"", 0}, {"", 0}, {"\n", 1}], 10) = 145<span> [pid 6744] exit_group(127) = ?</span></span></span></span></span>
定为到报错信息 undefined symbol: mmc_queue_pop
6、既然是 memcache 扩展报错,便开始折腾,从基本编译命令开始
cd /data/memcache-3.0.8/<br />/usr/local/php/bin/<span>phpize ./configure --with-php-config=/usr/local/php/bin/php-<span>config<br />#sudo make clean #但存在多次编译安装时,最好都进行清除 sudo make sudo make install</span></span>
仔细查找,发现 ./configure 报了个 WARNING
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
于是开始补齐 re2c,并重新编译 memcache,重启 php-fpm,然而依旧报错
7、最后找到一篇文章,提及“我的memcache原来是从官网下的beta版,重新下载一个stable版本编译安装一下问题就OK了”
而我用的正是beta版的 memcache-3.0.8,于是马上下载stable版的 memcache-2.2.7 重新编译,问题成功解决。
(http://www.phpjiayuan.com/77/433.html)
四、特别申明:此文章所提及的东西,部分来自某开发群的大神们,在此鸣谢!
五、后记:此问题是不是只存在于 php 5.5.33 + memcache-3.0.8(beta),有待后续跟进

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Want to copy a page in Microsoft Word and keep the formatting intact? This is a smart idea because duplicating pages in Word can be a useful time-saving technique when you want to create multiple copies of a specific document layout or format. This guide will walk you through the step-by-step process of copying pages in Word, whether you are creating a template or copying a specific page in a document. These simple instructions are designed to help you easily recreate your page without having to start from scratch. Why copy pages in Microsoft Word? There are several reasons why copying pages in Word is very beneficial: When you have a document with a specific layout or format that you want to copy. Unlike recreating the entire page from scratch

General Matrix Multiplication (GEMM) is a vital part of many applications and algorithms, and is also one of the important indicators for evaluating computer hardware performance. In-depth research and optimization of the implementation of GEMM can help us better understand high-performance computing and the relationship between software and hardware systems. In computer science, effective optimization of GEMM can increase computing speed and save resources, which is crucial to improving the overall performance of a computer system. An in-depth understanding of the working principle and optimization method of GEMM will help us better utilize the potential of modern computing hardware and provide more efficient solutions for various complex computing tasks. By optimizing the performance of GEMM

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

Yesterday during the interview, I was asked whether I had done any long-tail related questions, so I thought I would give a brief summary. The long-tail problem of autonomous driving refers to edge cases in autonomous vehicles, that is, possible scenarios with a low probability of occurrence. The perceived long-tail problem is one of the main reasons currently limiting the operational design domain of single-vehicle intelligent autonomous vehicles. The underlying architecture and most technical issues of autonomous driving have been solved, and the remaining 5% of long-tail problems have gradually become the key to restricting the development of autonomous driving. These problems include a variety of fragmented scenarios, extreme situations, and unpredictable human behavior. The "long tail" of edge scenarios in autonomous driving refers to edge cases in autonomous vehicles (AVs). Edge cases are possible scenarios with a low probability of occurrence. these rare events

The best version of the Apple 16 system is iOS16.1.4. The best version of the iOS16 system may vary from person to person. The additions and improvements in daily use experience have also been praised by many users. Which version of the Apple 16 system is the best? Answer: iOS16.1.4 The best version of the iOS 16 system may vary from person to person. According to public information, iOS16, launched in 2022, is considered a very stable and performant version, and users are quite satisfied with its overall experience. In addition, the addition of new features and improvements in daily use experience in iOS16 have also been well received by many users. Especially in terms of updated battery life, signal performance and heating control, user feedback has been relatively positive. However, considering iPhone14

System76 has made waves recently with its Cosmic desktop environment, which is slated to launch with the next major alpha build of Pop!_OS on August 8. However, a recent post on X by System76 CEO, Carl Richell, has tipped that the Cosmic DE developer

On April 11, Huawei officially announced the HarmonyOS 4.2 100-machine upgrade plan for the first time. This time, more than 180 devices will participate in the upgrade, covering mobile phones, tablets, watches, headphones, smart screens and other devices. In the past month, with the steady progress of the HarmonyOS4.2 100-machine upgrade plan, many popular models including Huawei Pocket2, Huawei MateX5 series, nova12 series, Huawei Pura series, etc. have also started to upgrade and adapt, which means that there will be More Huawei model users can enjoy the common and often new experience brought by HarmonyOS. Judging from user feedback, the experience of Huawei Mate60 series models has improved in all aspects after upgrading HarmonyOS4.2. Especially Huawei M

Page refresh is very common in our daily network use. When we visit a web page, we sometimes encounter some problems, such as the web page not loading or displaying abnormally, etc. At this time, we usually choose to refresh the page to solve the problem, so how to refresh the page quickly? Let’s discuss the shortcut keys for page refresh. The page refresh shortcut key is a method to quickly refresh the current web page through keyboard operations. In different operating systems and browsers, the shortcut keys for page refresh may be different. Below we use the common W
