When I send a webform it takes ages before the confirmation page loads and the email is sent. Sometimes I get a MySQL error starting with: MySQL server has gone away query and no email is sent at all. My Drupal installation runs on a shared host. Could this have something to do with the max_allowed_packet setting?

Drupal 6.20
PHP 5.2.14
MySQL 5.0.91

Comments

quicksketch’s picture

It's hard to say where things are failing for you. Usually the MySQL server won't just give you the "gone away" message unless MySQL has completely crashed or become unavailable. If it were another common error like "Too many connections" or "Packet exceeded max_allowed_packet" it would tell you that particular error. On a shared server, the most likely situation is that another user on your same machine is flooding the MySQL server with queries and it can't handle all of them, causing MySQL to crash (which also means it's probably not configured correctly, since this should never happen. MySQL should stop accepting connections before it crashes). It may even be your application, which is the first thing to check. Turn on Devel module and enable displaying of queries. Check how many queries are happening upon submission of your Webform. You should get one INSERT query per field you have in your form, plus about 100 queries from Drupal just loading the pages. If you're seeing an extrodinary number of queries (1500 or more) it's probably a module causing your problem. If it's a modest number of queries (less than 400) you should contact your hosting company.

m@rtijn’s picture

I doubt the MySQL server is flooded by other users, because the problem should exist randomly on the whole website in such a case. I only experience slow loadings when a webform is trying to submit. The SQL error sometimes show up, only when trying to submit a webform.

I'll check the number of queries Webform is using upon submission.

m@rtijn’s picture

Because of a lack of time it took a few days until I tested the webform submission again. Somehow it works just fine now. Probably the host provider tweaked something.

quicksketch’s picture

Hm, well so I guess we'll mark this fixed.

metakel’s picture

I had encountered this situation before. It turned out to be the mail server's slow response caused the problem.

You may try checking your mail server's speed to see whether it helps.

quicksketch’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.