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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | yamlform_submission-2811453-7.patch | 4.71 KB | jrockowitz |
| #3 | yamlform_submission-2811453-3.patch | 4.62 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedThe 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.
Comment #3
jrockowitz commentedComment #7
jrockowitz commentedComment #9
jrockowitz commentedComment #10
robpowelllightning 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.
Comment #11
jrockowitz commentedOne 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.