Problem/Motivation

I have a yamlform with approximately 70 fields and recently ran into an issue with the above error message. This issue is related to two fields you can find in your my.cnf (usually @ /etc/my.cnf) max_allowed_packet and wait_timeout. My max_allowed was set to ~260M so it wasn't the smoking gun and I focused my energy on wait_timeout. Per the mysql docs, the default for this value is 8hrs (28800 seconds) but mine was set for 20 seconds. Once I updated this value the submission worked. So problem fixed riiiight?

The real "problem" here is that the submission is taking 20 seconds. This seems like a huge performance issue because I am only one person, what if I get 5, 10, or 100 of these going at the same time?

Proposed resolution

- determine if the submission query is performing as designed
- determine if there are any performance changes that can be made to either the sql code, drupal, or the tables

Remaining tasks

User interface changes

API changes

Data model changes

Possible implications on the data model due to sql optimization.

Comments

robpowell created an issue. See original summary.

jrockowitz’s picture

Priority: Normal » Critical

The bottleneck is not actually the SQL query but this function \Drupal\yamlform\YamlFormSubmissionStorage::getElementDataSchema which is loading every element's meta data.

The MySQL has gone away is a result of the save query's transaction taking too long because of the poorly optimized code.

Marking this as critical and I will fix it ASAP.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new4.62 KB

  • jrockowitz committed bda7a78 on 2811453-performance-issue
    Issue #2811453 by jrockowitz: yamlform submission fail sql error mysql...

Status: Needs review » Needs work

The last submitted patch, 3: yamlform_submission-2811453-3.patch, failed testing.

  • jrockowitz committed 525764d on 2811453-performance-issue
    Issue #2811453 by jrockowitz: yamlform submission fail sql error mysql...
jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new4.71 KB

  • jrockowitz committed 63eb5d1 on 8.x-1.x
    Issue #2811453 by jrockowitz, robpowell: yamlform submission fail sql...
jrockowitz’s picture

Status: Needs review » Fixed
robpowell’s picture

lightning fast! thanks.

Speaking about "lightning", I did a lightning talk yesterday at the boston,ma drupal meetup. I spoke briefly about my use case with yaml form and how it has helped me ot only with my project but with onboarding me into the drupal community. Everyone liked it.

jrockowitz’s picture

One of the things I am enjoying most while working on the YAML Form module is the fact that a large number of issues are being filed by people who are completely new to the Drupal community.

Funny, you should mention meetups, I am doing a full presentation tonight at the NYC Drupal Meetup. I am hoping it is going to be recorded.

Status: Fixed » Closed (fixed)

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