:(Upgrading from 1.6 to 1.7 after Too many connections

I was using the Chinese version from 1.6 online upgrade to 1.7

If there is a statistical data warehousing is a login to access the tips I configuration file config.ini.php is impaired or not to connect database.
If the foreign service port is closed, do not accept the statistical data storage, login to view the report is normal.

Then I according to page tips removed may have impaired reconfigures the config.ini.php, choose to retain the history data, continue to provide statistical services login to view, or tip "SQLSTATE[08004] [1040] Too many connections "
, or suggest that piwik is not installed.

I once again try to delete the piwik directory, WGet download version 1.7 decompression reset configuration data, still retains the original data, provide services to accept statistical data, a login prompt" SQLSTATE [08004 ] [1040 ] Too many connections", refresh times automatically from the login state or not installed piwik.

Because must provide user statistics service, but relocated in 1.6 versions and the new database, to ensure that a user accessing data can now normal statistics, is it right? 1.7 serious BUG leads to storage anomaly, but with the 1.6 version in the same database configuration no problem. Because the processing time is very urgent, did not come and capture the error interface, do not know whether to submit BUG. The original upgraded 1.7 database for the current 27 G

Total 211365900 17.5 Gb 9.6 Gb 27 Gb

See Performance regression in tracker for high traffic website · Issue #2951 · matomo-org/matomo · GitHub

Thank you very much, the performance problems were finally solved, restored to the 1.6 version almost occupancy rate

The current server performance diagram

[attachment 518 s5.jpg]

A site where user data access

[attachment 519 s6.jpg]

Can you please update to 1.7 again, and try the patch in: 301 Moved Permanently

I am looking for testers to confirm that the new file works fast for everyone. Please test if you can it would really help!!

Thank you very much for your help and guidance.

Now my version is 1.7, made you said patch."Can you please replace your core/Tracker/Visit.php file with this one: [dev.piwik.org/svn/trunk/core/Tracker/Visit.php] ”

I shot the meaning that the server has returned to normal.
[attachment 520 s7.jpg]

Great!! So performance is perfect for you with the new file?

$ls -al Visit.php
-rw-r–r-- 1 piwik piwik 51149 02-24 13:58 Visit.php

$wc -l Visit.php
1576 Visit.php

Now lost site 4 subsequent statistical data

Site 4 tabulation normal
[attachment 528 s10.jpg]

Site 6 is not normal, no browser data
[attachment 527 s9.jpg]

To visit often appears
[attachment 526 s8.jpg]


$sh /piwik/misc/cron/archive.sh
……
262701
265517
260816
258989
79746

124399
142608

Archiving period = week for idsite = 4…
PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0

Fatal error: Exception thrown without a stack frame in Unknown on line 0

real 3m16.726s
user 0m6.195s
sys 0m0.380s

Site 5 and site 6 in where?


$ php archive.php
[2012-02-25 07:51:34] [44207042] ---------------------------
[2012-02-25 07:51:34] [44207042] INIT
[2012-02-25 07:51:34] [44207042] Querying Piwik API at: http://piwik/index.php
[2012-02-25 07:51:34] [44207042] Running as Super User: root
[2012-02-25 07:51:34] [44207042] Notes
[2012-02-25 07:51:34] [44207042] - Reports for today will be processed at most every 1800 seconds. You can change this value in Piwik UI > Settings > General Settings.
[2012-02-25 07:51:34] [44207042] - Reports for the current week/month/year will be refreshed at most every 3600 seconds.
[2012-02-25 07:51:34] [44207042] --force-all-periods was detected: we will process websites with visits in the last 7 days 0 hours
[2012-02-25 07:53:55] [44207042] Will process 5 websites with new visits since 7 days 0 hours , IDs: 1, 3, 4, 5, 6
[2012-02-25 07:53:56] [44207042] ---------------------------
[2012-02-25 07:53:56] [44207042] START
[2012-02-25 07:53:56] [44207042] Starting Piwik reports archiving…
[2012-02-25 07:54:21] [44207042] ERROR: Got invalid response from API request: http://piwik/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=day&date=last2&format=php&token_auth=04fa118e9bec7ec12a891f2ca01984f8&trigger=archivephp. Response was 'curl_exec: couldn’t connect to host’
Error in the last Piwik archive.php run:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Here is the full output of the script:


INIT
Querying Piwik API at: http://piwik/index.php
Running as Super User: root
Notes

  • Reports for today will be processed at most every 1800 seconds. You can change this value in Piwik UI > Settings > General Settings.
  • Reports for the current week/month/year will be refreshed at most every 3600 seconds.
    –force-all-periods was detected: we will process websites with visits in the last 7 days 0 hours
    Will process 5 websites with new visits since 7 days 0 hours , IDs: 1, 3, 4, 5, 6

START
Starting Piwik reports archiving…
ERROR: Got invalid response from API request: http://piwik/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=day&date=last2&format=php&token_auth=04fa118e9bec7ec12a891f2ca01984f8&trigger=archivephp. Response was ‘curl_exec: couldn’t connect to host’
[2012-02-25 07:54:21] [44207042] ERROR: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
PHP Fatal error: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /piwikmisc/cron/archive.php on line 487

Fatal error: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /piwikmisc/cron/archive.php on line 487

Why is this wrong?

I see Google say because the script in the execution of a query, then there is another very time-consuming without any database query operation ( more than the value of the wait_timeout setting, the unit is seconds ), followed by the database operations, it will encounter errors.

Is it because the site 1 to 4 historical data too much, leading to the search time is too long, so to site 5, 6 have been lost?

“MySQL server has gone away” - probably there is too much data or your mysql server is not tuned?
Can you please enable Mysql slow query log, and send me by email the slow query log after a few hours? to matt (att) piwik.org - Thanks

To anyone else, please apply the patch and confirm if the Tracking queries are fast now?

OK,Long_query_time is a few seconds right definition