MySQL Server Has Gone Away [2.10.4 and 2.10.5 - MySQL 4 &

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

MySQL Server Has Gone Away [2.10.4 and 2.10.5 - MySQL 4 &

Postby harshad » 6:23am, Fri 28 Sep, 2007

I was running phplist 2.10.4 on GoDaddy shared hosting and was trying to send a mail to 1100 odd subscribers

The first 300 odd mails went out but then i kept getting the errors -

Database error 2013 while doing query Lost connection to MySQL server during query
Database error 2006 while doing query MySQL server has gone away
Database error 2006 while doing query MySQL server has gone away
Database error 2006 while doing query MySQL server has gone away
Database error 2006 while doing query MySQL server has gone away

I tried suspend - requeue many times

I tried many combinations of batches as well as disabling batches altogether using combinations of the following settings

define("MAILQUEUE_BATCH_SIZE",200);
define("MAILQUEUE_BATCH_PERIOD",200);
define('MAILQUEUE_THROTTLE',1);

However the error persisted.

So I upgraded to the newer 2.10.5, yet no luck still the same errors

I saw some posts say that it was a problem with MySQL 5 so I migrated the DB to MySQL 41 and yet.......it failed.

I wrote to GoDaddy and they say the problem is with the scripts and not the server.

I have now more on less given up. If anybody has any idea of how this can be fixed, pleeeaaasssssseeeee let me know.

thanks,
harshad
harshad
phpList newbie
 
Posts: 4
Joined: 6:02am, Fri 28 Sep, 2007


No Solution On Those Links

Postby harshad » 12:42pm, Fri 28 Sep, 2007

I have seen and tried out the suggestions on the pages you have mentioned however those unfortunately have not fixed the problem.

Is there a solution for this issue?
harshad
phpList newbie
 
Posts: 4
Joined: 6:02am, Fri 28 Sep, 2007

Re: MySQL Server Has Gone Away [2.10.4 and 2.10.5 - MySQL 4

Postby H2B2 » 2:39pm, Fri 28 Sep, 2007

harshad wrote:define("MAILQUEUE_BATCH_SIZE",200);
define("MAILQUEUE_BATCH_PERIOD",200);
define('MAILQUEUE_THROTTLE',1);
With these settings you tell phplist to send batches of 200 mails every 200 seconds and to pause 1 second between mails. This does seem to be a recipe for trouble. Whether or not that would be the only cause for the problem is hard to say, but I suggest you start by changing these settings first, and then see if you need to continue troubleshooting.

Assuming you have an hourly message limit of 1000 messages, you might try these settings for instance:
Code: Select all
define("MAILQUEUE_BATCH_SIZE",0);
define("MAILQUEUE_BATCH_PERIOD",3600);
define('MAILQUEUE_THROTTLE',4);

This will disable batch processing (set 0), and pause 4 seconds between each message, i.e. it will not send more than 900 messages per hour.

Again, see http://docs.phplist.com/PhpListConfigSendRate for more info.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

MySQL Server has gone away

Postby leftfork » 6:59pm, Wed 03 Oct, 2007

Were you able to resolve this? I keep getting the same error with a shared server on GoDaddy and I have tried various combinations. My last settings are:

define("MAILQUEUE_BATCH_SIZE",0);
define("MAILQUEUE_BATCH_PERIOD",3600);
define('MAILQUEUE_THROTTLE',1);

I have tried with throttle=4/5 with no luck. I also tried Batch_size=67, Batch_period=600 (as suggested by another user).

Also, every time I suspend and requeue the task, I looks like 1 email is going out and then it gives the error message.
leftfork
phpList newbie
 
Posts: 1
Joined: 6:57pm, Wed 03 Oct, 2007

Trial Error and Prayer

Postby harshad » 5:17am, Mon 22 Oct, 2007

This just looks like it's a bug in PhpList that gets highlighted on GoDaddy

I keep trying combinations of batch size, throttle, etc. until something works

50 message with 8 seconds gap over 400 seconds worked at one time but did not work later.

So it's just trial and error and prayer that can get you through
harshad
phpList newbie
 
Posts: 4
Joined: 6:02am, Fri 28 Sep, 2007

Development version fixed the issue for the time being

Postby harshad » 7:58pm, Tue 23 Oct, 2007

Installed development version 2.11.2 and
fortunately my mail finally has gone through. So problem resolved at least for this one time.

I still occasionally did get the Mysql error but requeuing got things restarted

So if all seems lost, try the development version before you give up.

You can directly paste your old config into the new installation dir. So setup is fairly simple.

You can find the download link at Sourceforge or in the PhpList News section
harshad
phpList newbie
 
Posts: 4
Joined: 6:02am, Fri 28 Sep, 2007

Postby XDude » 6:18pm, Thu 14 Feb, 2008

Same problem, also on GoDaddy.

All I had to do was threaten to upgrade PHPList (from 2.10.4) and it magically started working.

:shock:
XDude
PL Nut
 
Posts: 17
Joined: 10:17pm, Mon 23 Oct, 2006

Re: MySQL Server Has Gone Away [2.10.4 and 2.10.5 - MySQL 4 &

Postby snyperthugs » 10:50pm, Tue 25 May, 2010

what settings would I use to make it send 80 messages per hour? but less than 30 per min.

If you experience MySQL timeouts, it's possible you are using heavy or very long MySQL queries. Please try using mysql_reconnect command before each query, and everything should be fine. WHERE DO I PUT THAT? :oops: :oops: :oops: :oops:
snyperthugs
phpLister
 
Posts: 6
Joined: 6:58am, Tue 13 May, 2008

Re: MySQL Server Has Gone Away [2.10.4 and 2.10.5 - MySQL 4 &

Postby martindickson » 12:55pm, Thu 23 Sep, 2010

No sure if somebody has answered this but here is the problem for dummies like me and what you do.

Problem 1: Spammers have caused us all issues so our servers don't like us sending out mass mailings even if they are legitimate so they limit the number of emails per hour and usually another time-scale too. My server is 100 per hour (or 3600 seconds) and 30 per 5mins (or 300 seconds).

The simple solution to problem 1 is to limit PHPlist using config.php to 100 emails per 3600seconds and throttle it with a delay so that it doesn't exceed 30 per 5mins. This causes problem 2.

Problem 2: If you use a delay of lets say 10secs per email it asks the database a new question every 10secs and the server gets annoyed either because of the pause or because of the constant nagging.

The solution: Use config.php to limit the number of emails sent by the lowest time-frame not the biggest and make sure the total doesn't exceed the bigger time-frame limit. So there is no pause, no nagging, just a nice new script every few mins.

Eg: I can send 100 per hour and 30 per 5mins. There are 12x5mins in a hour. Therefore if I sent:

1 email every 5mins (300secs) I would send 12 per hour (Solves the problem but too slow)
2 emails every 5mins I would send 24 per hour (Still too slow)
10 emails every 5mins I would send 120 per hour (Faster but over my limit)
8 emails every 5mins I send 96 per hour (Fast as possible while not going over my limit)

So I go to config.php and I do this:

# batch processing
...
define("MAILQUEUE_BATCH_SIZE",8);
define("MAILQUEUE_BATCH_PERIOD",300);
define('MAILQUEUE_THROTTLE',0);

Hope that helps somebody,

Martin
martindickson
phpList newbie
 
Posts: 4
Joined: 12:32pm, Thu 23 Sep, 2010

Re: MySQL Server Has Gone Away [2.10.4 and 2.10.5 - MySQL 4 &

Postby martindickson » 1:55pm, Thu 23 Sep, 2010

snyperthugs wrote:what settings would I use to make it send 80 messages per hour? but less than 30 per min.

If you experience MySQL timeouts, it's possible you are using heavy or very long MySQL queries. Please try using mysql_reconnect command before each query, and everything should be fine. WHERE DO I PUT THAT? :oops: :oops: :oops: :oops:


Hi,

I found that the mysql_reconnect command doesn't work with my install of Phplist; there are tons of side effects.

Your best settings are probably something like 30 emails per 22.5mins which is exactly 80per hour and would be 30 per min each time it runs. Better safe than sorry with the timings so go for 29 mails per send (each batch goes instantly remember) with a 1350 second gap between each send which equals 77 emails per hour.

So the settings in the config.php are:

define("MAILQUEUE_BATCH_SIZE",29);
define("MAILQUEUE_BATCH_PERIOD",1350);
define('MAILQUEUE_THROTTLE',0);
martindickson
phpList newbie
 
Posts: 4
Joined: 12:32pm, Thu 23 Sep, 2010


Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest