Page 1 of 1
How to fix? MySQL server has gone away Error No: 2006
Posted: Sun Apr 06, 2014 2:43 pm
by Screwball
I am running Version 1.5.5.1, using Journal theme and have vqmod installed with one vqmod extension - Advanced Reviews (VQMod).
I am hosted on a shared linux server with storminternet.co.uk. Recently, they rebooted the server and the errors seem (to me) to have appeared more often since the reboot. After contacting storminternet, they said 'This seems to be problem with your script execution time and or your script is closing mysql connection.'
Now I haven't changed any script execution time or altered anything else since I installed v.1.5.5.1 back in August last year. I have a suspicion that this is storminternet's problem but I don't really know enough about SQL or PHP to know what to say to them.
Am I correct in thinking this is a hosting issue or is there something wrong with my php.ini file (I have copied the contents below)?
This error is beginning to cause problems, as the other day I was adding products to my store and it kept timing out and throwing up the error. It took forever to get 4 products added to the store.
Error:
Code: Select all
PHP Notice: Error: MySQL server has gone away<br />Error No: 2006<br />SELECT * FROM `language` WHERE status = '1' in /home/mydomain/public_html/system/database/mysql.php on line 50
Copy of PHP.ini file contents:
Code: Select all
magic_quotes_gpc = Off;
register_globals = Off;
default_charset = UTF-8;
memory_limit = 64M;
max_execution_time = 36000;
upload_max_filesize = 999M;
safe_mode = Off;
mysql.connect_timeout = 20;
session.use_cookies = On;
session.use_trans_sid = Off;
session.gc_maxlifetime = 172800;
allow_url_fopen = on;
;display_errors = 0;
;error_reporting = E_ALL;
max_input_vars = 9999
Any help which anyone can give on how to fix this would really be appreciated!
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Sun Apr 06, 2014 4:58 pm
by grgr
Change host!
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Sun Apr 06, 2014 6:13 pm
by OSWorX
grgr wrote:Change host!
The faster the better!
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Sun Apr 06, 2014 8:06 pm
by rph
One thing that can cause this is Google Base and Google Sitemap feeds on a store with a high number of products or categories.
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Mon Apr 07, 2014 2:49 pm
by Screwball
Thanks for your replies, as I suspected, it's my hosting. Thanks again
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Fri Nov 28, 2014 7:56 pm
by theos17
Hi,
I am having the same problem. Did you find any solution? Please help.
Thanks
Theos
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Fri Nov 28, 2014 9:18 pm
by OSWorX
theos17 wrote:Hi,
I am having the same problem. Did you find any solution? Please help.
Thanks
Theos
As already written above, such an error is based mainly on
* poor configured servers
* too many customers on 1 server (happen always at cheap providers)
* too many database queries (can be also the summary of all customers of this server)
Solutions can be
* change provider
* change server (e.g. update to a better hosting package)
* change database server (if possible - talk with your provider)
* change to a dedicated server (where only you are the only customer)
* check your database queries (and if possible solve bottlenecks if existing)
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Wed Sep 23, 2015 3:15 pm
by Swordfish2
I am using 2.0.3.1 and all was well for a couple of days and this error is coming now which has completely stopped the site loading. I could log into the PHPmyadmin and take backup. Host has replied with this:
=====================
we have checked and found that mysql service is taking the high CPU utilization in the server.
And we have restart the mysql service, then websites are working but it is opening slow because MySQL is taking high CPU utilization.
For your reference, please find the below
top - 11:00:01 up 5:34, 2 users, load average: 31.80, 24.90, 24.65
Tasks: 78 total, 3 running, 75 sleeping, 0 stopped, 0 zombie
Cpu(s): 43.3%us, 56.3%sy, 0.0%ni, 0.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1048576k total, 809752k used, 238824k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 33052k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16047 mysql 20 0 701m 34m 4532 S 94.8 3.3 4:42.79 mysqld
16321 apache 20 0 513m 31m 4112 R 3.0 3.1 0:00.16 httpd
16289 apache 20 0 502m 21m 4224 S 1.0 2.1 0:00.56 httpd
565 root 20 0 64440 312 208 S 0.3 0.0 0:01.80 sshd
16146 root 20 0 15008 1176 928 R 0.3 0.1 0:00.23 top
16339 root 20 0 101m 4536 3332 S 0.3 0.4 0:00.02 sshd
1 root 20 0 19236 408 288 S 0.0 0.0 0:00.25 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd/506
3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper/506
133 root 16 -4 10652 68 64 S 0.0 0.0 0:00.00 udevd
501 root 20 0 243m 1748 516 S 0.0 0.2 0:02.89 rsyslogd
531 dbus 20 0 21408 20 16 S 0.0 0.0 0:00.00 dbus-daemon
556 sw-cp-se 20 0 45704 24 20 S 0.0 0.0 0:00.00 sw-cp-serverd
573 root 20 0 22100 348 252 S 0.0 0.0 0:00.00 xinetd
759 root 20 0 64604 168 32 S 0.0 0.0 0:00.00 saslauthd
761 root 20 0 64604 144 16 S 0.0 0.0 0:00.00 saslauthd
773 root 20 0 13976 132 4 S 0.0 0.0 0:00.00 couriertcpd
777 root 20 0 3936 68 4 S 0.0 0.0 0:00.00 courierlogger
783 root 20 0 13976 132 4 S 0.0 0.0 0:00.00 couriertcpd
786 root 20 0 3936 68 4 S 0.0 0.0 0:00.00 courierlogger
791 root 20 0 13976 136 4 S 0.0 0.0 0:00.00 couriertcpd
794 root 20 0 3936 72 4 S 0.0 0.0 0:00.00 courierlogger
800 root 20 0 13976 128 4 S 0.0 0.0 0:00.00 couriertcpd
803 root 20 0 3936 72 4 S 0.0 0.0 0:00.00 courierlogger
Kindly tune the mysql application in the application level.
=====================
it was loading fine till last night and suddenly it started to load very slow. Have done no heavy changes except a few minor ones in the theme.
The admin panel is loading sometimes so i had put OC in maintenance mode and now the theme and maintenance message seems to load without problems but when i long as an admin or remove the maintenance mode, everything falls apart. take a few minutes for each page and throws that error "MySQL server has gone away" and i don't know how to fix this.
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Wed Sep 23, 2015 5:22 pm
by Swordfish2
I am using a VPS plan.
Here is another message from the host support:
=======================================
we have checked at server level and we have observed the below logs from server .
Sep 23 11:09:58 ns1 kernel: [30753173.504662] Out of memory in UB 506: OOM kille d process 16498 (mysqld) score 0 vm:722708kB, rss:36612kB, swap:0kB
Sep 23 11:18:34 ns1 kernel: [30753689.584142] Out of memory in UB 506: OOM kille d process 17079 (mysqld) score 0 vm:722752kB, rss:36572kB, swap:0kB
Sep 23 11:26:37 ns1 kernel: [30754172.826489] Out of memory in UB 506: OOM kille d process 17632 (mysqld) score 0 vm:723440kB, rss:36928kB, swap:0kB
Sep 23 11:34:01 ns1 kernel: [30754616.680726] Out of memory in UB 506: OOM kille d process 18102 (httpd) score 0 vm:599792kB, rss:105196kB, swap:0kB
Sep 23 11:34:53 ns1 kernel: [30754669.290283] Out of memory in UB 506: OOM kille d process 17972 (mysqld) score 0 vm:722324kB, rss:37268kB, swap:0kB
Sep 23 11:43:09 ns1 kernel: [30755164.925958] Out of memory in UB 506: OOM kille d process 18357 (mysqld) score 0 vm:722288kB, rss:36000kB, swap:0kB
Sep 23 12:37:52 ns1 kernel: [30758450.155923] Out of memory in UB 506: OOM kille d process 21479 (httpd) score 0 vm:563812kB, rss:67040kB, swap:0kB
Sep 23 12:38:21 ns1 kernel: [30758478.574438] Out of memory in UB 506: OOM kille d process 18743 (mysqld) score 0 vm:742760kB, rss:40864kB, swap:0kB
Sep 23 12:55:50 ns1 kernel: [30759528.242950] Out of memory in UB 506: OOM kille d process 23979 (mysqld) score 0 vm:723132kB, rss:36756kB, swap:0kB
Sep 23 13:02:45 ns1 kernel: [30759943.558465] Out of memory in UB 506: OOM kille d process 24933 (mysqld) score 0 vm:723812kB, rss:35064kB, swap:0kB
=======================================
and i have no idea what this is.
Another reply from host says:
=======================================
We have received an update from linux team for the issue, we have checked and increased the swap size on the server.
=======================================
After that the site loaded once and went back to its old state.
The situation now is that i cannot see any errors. The pages just say loading... without loading anything at all for ever.
any ideas anybody?
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Wed Sep 23, 2015 6:48 pm
by OSWorX
Swordfish2 wrote:I am using a VPS plan.
Another reply from host says:
=======================================
We have received an update from linux team for the issue, we have checked and increased the swap size on the server.
=======================================
After that the site loaded once and went back to its old state.
The situation now is that i cannot see any errors. The pages just say loading... without loading anything at all for ever.
Swordfish2 wrote:any ideas anybody?
As already written: change the provider - asap.
Because it seems that they have no plan what they are doing ..
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Wed Sep 23, 2015 7:15 pm
by Swordfish2
Okay, they shared with me the full processlist for mysql and there was one query which took 21 minutes to execute.
I figured it is coming from a display module in Journal theme - which is "Also Bought"
This is is basically messing the whole system - may be because it does not have cache?
I restarted the VPS, was able to log into the admin, removed the module/display section from appearing in the product page, saved the theme and everything is in place now.
I dont know if this is the case for me only or that thing is not done right in the first place.
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Thu Sep 24, 2015 12:59 am
by OSWorX
Swordfish2 wrote:Okay, they shared with me the full processlist for mysql and there was one query which took 21 minutes to execute.
I figured it is coming from a display module in Journal theme - which is "Also Bought"
This is is basically messing the whole system - may be because it does not have cache?
I restarted the VPS, was able to log into the admin, removed the module/display section from appearing in the product page, saved the theme and everything is in place now.
I dont know if this is the case for me only or that thing is not done right in the first place.
This can be a result if a template designer think he can develop code.
Conclusion: always test a shop with standard settings only (in case you have troubles like that).
If that works, the 'evil' will be an extension (or them in this case ..).
Increasing (if accepted by the server which not many providers will do) the values inside the php.ini cannot be the solution (and should be never done - especially with that crazy definitions the enclosed php.ini currently has!).
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Thu Sep 24, 2015 1:29 pm
by Alexitaylor
Adding this line into my.cnf file solves my problem.
This is useful when the columns have large values, which cause the issues, you can find the explanation here.
On Windows this file is located at: "C:\ProgramData\MySQL\MySQL Server 5.6" On Linux (Ubuntu): /etc/mysql
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Thu Sep 24, 2015 5:35 pm
by OSWorX
Alexitaylor wrote:Adding this line into my.cnf file solves my problem.
This is useful when the columns have large values, which cause the issues, you can find the explanation here.
On Windows this file is located at: "C:\ProgramData\MySQL\MySQL Server 5.6" On Linux (Ubuntu): /etc/mysql
How many users do know about such technical details??
And how many have access to those files on a public webserver??
Users should be able to sell their products (via their shop) and not being a technician!
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Fri Sep 25, 2015 12:20 pm
by ASG
Swordfish2 wrote:Okay, they shared with me the full processlist for mysql and there was one query which took 21 minutes to execute.
I figured it is coming from a display module in Journal theme - which is "Also Bought"
This is is basically messing the whole system - may be because it does not have cache?
I restarted the VPS, was able to log into the admin, removed the module/display section from appearing in the product page, saved the theme and everything is in place now.
I dont know if this is the case for me only or that thing is not done right in the first place.
21 minutes to execute for a simple module? I am using journal 2, and can attest that it is not a theme you want to run on cheap hosting. I was with GoDaddy shared hosting, and within an hour of just installing the theme started getting mysql errors. And I hadn't even installed other extensions yet.
Change your hosting instead of digging around and hacking code to get it working. Probability is if doesn't work with just the theme installed, it is going to get worse when you have some more extensions installed, and add more products.
It is amazing that how people want to run a business on a $5 hosting. There are much better hosts available at less than $10 here on the forums itself.
Re: How to fix? MySQL server has gone away Error No: 2006
Posted: Wed Nov 25, 2015 1:52 am
by hostpreneur
You should try host preneur limited that is one limited company who is providing this kind of solutions.