Piwik page stuck problem tracing record

Source: Internet
Author: User
Tags php session piwik
Today, piwik is boring, but it is found that there is a probability that the page will be 504. Viewing nginx logs is a php Execution timeout, and after the first 504, all the subsequent page accesses will be 504, after restarting php-fpm, you can access it again. Leo108.compid-2007. asp is used to open the slowlog of php-fpm. When the page is 504, slowl

Today, piwik is boring, but it is found that there is a probability that the page will be 504. Viewing nginx logs is a php Execution timeout, and after the first 504, all the subsequent page accesses will be 504, after restarting php-fpm, you can access it again. The http://leo108.com/pid-2007.asp opened the slowlog of php-fpm and slowl at page 504.

Today, piwik is boring, but it is found that there is a probability that the page will be 504. Viewing nginx logs is a php Execution timeout, and after the first 504, all the subsequent page accesses will be 504, after restarting php-fpm, you can access it again. Http://leo108.com/pid-2007.asp

So open the php-fpm slowlog, in the page 504 slowlog also played the corresponding call Stack: This article from http://leo108.com

script_filename = /home/www/online/website/piwik/index.php[0x00007fbec1568f48] session_start() /home/www/online/website/piwik/libs/Zend/Session.php:469[0x00007fbec1568370] start() /home/www/online/website/piwik/core/Session.php:113[0x00007fbec1567e68] start() /home/www/online/website/piwik/core/FrontController.php:416[0x00007fbec1567a08] prepareDispatch() /home/www/online/website/piwik/core/FrontController.php:502[0x00007fbec15675f8] doDispatch() /home/www/online/website/piwik/core/FrontController.php:84[0x00007fbec15671d0] dispatch() /home/www/online/website/piwik/core/dispatch.php:34[0x00007fbec15669a0] +++ dump failed

It seems that the execution of session_start is stuck, and the php session has a lock mechanism. If a session is enabled on a page and the request has not ended, all subsequent requests for this session will be locked and wait until the previous request ends. This article from http://leo108.com

That is to say, the reason why the piwki page is stuck is that a previous request has not ended, but which one has not ended? Because I didn't read the piwik code, and 504 appeared with a probability, it wasn't 504 after accessing a specific page. The problem encountered a bottleneck.

Zombie JJ

After half a day of drumming, I suddenly thought that the unfinished request would definitely be in the slowlog of php, so I checked it again, different logs are found in the slowlog of a bunch of sessions: PHP

script_filename = /home/www/online/website/piwik/index.php[0x00007fbec1568c40] curl_exec() /home/www/online/website/piwik/core/Http.php:483[0x00007fbec1568798] sendHttpRequestBy() /home/www/online/website/piwik/core/Http.php:94[0x00007fbec15685e0] sendHttpRequest() /home/www/online/website/piwik/core/Http.php:720[0x00007fbec1567e00] fetchRemoteFile() /home/www/online/website/piwik/plugins/ExampleRssWidget/RssRenderer.php:46[0x00007fbec1567be8] get() /home/www/online/website/piwik/plugins/ExampleRssWidget/Controller.php:25[0x00007fffe0d3cf00] rssPiwik() unknown:0[0x00007fbec1567788] call_user_func_array() /home/www/online/website/piwik/core/FrontController.php:531[0x00007fbec1567378] doDispatch() /home/www/online/website/piwik/core/FrontController.php:84[0x00007fbec1566f50] dispatch() /home/www/online/website/piwik/core/dispatch.php:34[0x00007fbec1566720] +++ dump failed

It looks like a curl calls an http request and traces the code in it. It is a public class and it is not a fixed request for a url. This is also simple, in curl_exec () add a logging code to record the curl request url.

PHP

So I casually noted down the piwik page, found that there is a record of a url: http://feeds.feedburner.com/Piwik

PHP

It looks like an rss url, directly in the grep url of piwik. The result is as follows: piwik

./plugins/ExampleRssWidget/Controller.php:            $rss = new RssRenderer('http://feeds.feedburner.com/Piwik');./plugins/ExampleRssWidget/Controller.php:            $rss = new RssRenderer('http://feeds.feedburner.com/PiwikReleases');

Is the code of a plug-in. Piwik

Go to the piwik background and disable ExampleRssWidget. Solve the problem!

This article from http://leo108.com

PS: China's national conditions ........................

Http://leo108.com/pid-2007.asp

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.