Hi, my drupal 7 site is hosted on MediaTemple's grid service. I'm consistently getting the below apparent timeout error on attempt to run my drupal cron job. Further below their support suggests adding a mysql container to see if has any effect on this issue. Does anyone else using MediaTemple have this issue, and does using the container service indeed address this? Thanks in advance for any info on this!:

PDOException: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction: DELETE FROM {history} WHERE (timestamp < :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1314291894 ) in node_cron() (line 161 of /nfs/c08/h01/mnt/120461/domains/domain.org/html/modules/node/node.module).

In reviewing your errors and current account, this is likely due to the way that the shared database server, the SmartPool, is set up on the (gs) Grid-Service. While we do everything we can to minimize this, we do apologize for the interruption to your service.

Basically, if one or several database users in the SmartPool start using a high percentage more than their share of database resources, our load balancing will kick in and move them temporarily to a private MySQL server. This keeps their site up and running and maintains a good database server environment for everyone else. While our monitoring is very good, it of necessity provides an after-the-fact fix. This can lead to a few minutes of database resource unavailability. If you want to learn more about the MySQL Database server architecture on the (gs) Grid-Service, see this article:

http://blog.mediatemple.net/weblog/2007/01/19/anatomy-of-mysql-on-the-grid/

There have indeed been a few brief latency spikes on your database server in the past twenty-four hours. If you decide that this shared environment is not for you, I suggest adding a MySQL Container to your hosting package. A MySQL Container will do two things for you. First, it will isolate you from other users, so you won't be affected by any "bad neighbors" in the SmartPool, even for brief periods of time. Second, it will allow you to run a more detailed analysis on all your queries, so you can be sure your own database use is fully optimized. It's completely seamless to move to and from a Container. See these articles for more details:

Getting started with your MySQL GridContainer
http://wiki.mediatemple.net/w/Getting_started_with_your_MySQL_GridContainer

Generating a MySQL report for your MySQL GridContainer
http://wiki.mediatemple.net/w/Generating_a_MySQL_report_for_your_MySQL_G... r

Installing a Drupal caching plugin can assist in the overall performance as well.

On the other hand, if the connection errors you're getting are frequent or prolonged, there may be some other cause for these connection errors. If you can provide us with the date, time, and duration of the outages you've been experiencing, we can help you look into this.

Comments

justageek’s picture

But my experience with the grid service was poor for any site of any size that used databases, I cancelled my grid account, it isn't designed to run something as large as a drupal install, I don't think. At least, it never worked for me.

mt_Drew’s picture

Hi there! I read through your support request & it seems like there's a possibility that this version of Drupal just may not play nicely with the SmartPool (or vice versa.) Adding a container is the next best step for troubleshooting. I see that some higher level techs are involved with your support request and troubleshooting the issue. You may also want to check out the (mt) Forums for some insight from other (mt) customers. http://forums.mediatemple.net
Good luck!

- (mt) Sara

fmilland’s picture

i also have issues with Drupal 7 in my (gs) service, it is very frustrating, i am even considering changing to another hosting provider, any updates on it?

ewebarchitecture’s picture

I had the same problem and eventually figured out that the problem on the grid servers is resolved by changing the MySQL tables from InnoDB to MyISAM. The most expeditious way to do this is to do a mysqldump from the command line, then open the mysqldump file and replace all occurrences of "InnoDB" with "MyISAM" and then reimport the data again from the command line. (Note: Media Temple recommends only converting a few of them, but my experience has been that converting virtually all of them was most effective over the long haul.)

I've never had any problems with Media Temple aside from this, and their staff did help me run this to ground which I very much appreciated. In case it helps anyone else out there, my convo with Media Temple and my specifics follows:

ME
--
Hi, folks:

Over the last couple of weeks, PDOExceptions associated with domain dharma-beads.net have developed that are now bringing administration of the site to its knees.

Specifically, when I'm logged in as the Drupal 7 administrator of the site, I consistently run into MySQL errors of the form:
-----
"Additional uncaught exception thrown while handling exception.
Original

PDOException: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction: SELECT 1 AS expression FROM {variable} variable WHERE ( (name = :db_condition_placeholder_0) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => drupal_js_cache_files ) in variable_set() (line 805 of /nfs/c02/h06/mnt/26995/domains/dharma-beads.net/html/includes/bootstrap.inc).
Additional

PDOException: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction: SELECT 1 AS expression FROM {variable} variable WHERE ( (name = :db_condition_placeholder_0) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => drupal_js_cache_files ) in variable_set() (line 805 of /nfs/c02/h06/mnt/26995/domains/dharma-beads.net/html/includes/bootstrap.inc)."
-----

I'm running MySQL 5 and PHP 5 with Drupal 7 for this domain. I've cleared the sessions and cache tables via phpMyAdmin with little success, and run check/analyze tables. Still no love.

If it's helpful, my Drupal administration login credentials are:

URL: **************
UN: **********
PN: **********

There's some (lame) documentation about this on Drupal's website as well (URL: http://drupal.org/node/1041298), but Media Temple is mentioned several times and I wonder if there's any info there that might be useful.

I think it's worth noting that these PDOExceptions occur ONLY when I'm logged in as the administrator. When I'm logged out, the site zips along just fine.

Please advise if there's any other information I can pass along that might help.

Regards,
Mattie
--
Mattie MacGregor, CTO
eWebArchitecture, Ltd.

MEDIA TEMPLE
--
Thank you for your inquiry.

There is an issue with Drupal 7 when it comes to MySQL. Many tables need to be converted to MyISAM to work correctly on the (gs) Grid-Service. They are as follows, and you should be able to perform the conversion using phpMyAdmin:

drupal_cache_* (any tables that start with this need conversion)
drupal_variable

Managing a MySQL database with phpMyAdmin
http://kb.mediatemple.net/questions/426

All new 1-Click Drupal 7.8 installations will be created with the necessary database tables in this format, so you should not need to worry with any future installs. Please see the following KnowledgeBase article for further detail on using the 1-Click installer:

Install Drupal using the 1-Click Applications Tool
http://kb.mediatemple.net/questions/1703

If you require any further assistance, please do not hesitate to contact us by replying to this support request, or by calling us at 877-578-4000. We are here 24/7 to assist you. Thank you for continuing to use (mt) Media Temple for your hosting needs.

Best regards,

Scott A
Customer Support
(mt) Media Temple

User Forums: http://kb.mediatemple.net/questions/824/

ME
--
Hi, Scott:

FYI, ultimately I was able to change the tables noted to MyISAM from InnoDB by running "MySQLdump" from the command line, modifying the export file appropriately, and then reimporting from the command line again. Thanks for that help.

However, I continue to see similar bottlenecks in the site. Is there any reason why I shouldn't simply convert virtually all of the MySQL tables to MyISAM from InnoDB engine?

Looking forward to your reply with anticipation,
Mattie
--
Mattie MacGregor, CTO
eWebArchitecture, Ltd.

MEDIA TEMPLE
--
Compared to MyISAM, InnoDB delivered 35x higher throughput on the Read / Write test and 5x higher throughput on the Read-Only test, with 90% scalability across 36 CPU cores. Generally InnoDB would work better, but you may want to contact Drupal support to ensure that this will not cause more issues.

If you have any further questions regarding your (mt) Media Temple services, please feel free to contact us at any time.

Best regards,

Jeff U.
Technical Support
(mt) Media Temple

ME
--
All database tables converted to MyISAM -- this corrected the problems.

chrisNtampa’s picture

This worked for me on the (gs). No more errors and admin is MUCH faster. Thanks!

There is an issue with Drupal 7 when it comes to MySQL. Many tables need to be converted to MyISAM to work correctly on the (gs) Grid-Service. They are as follows, and you should be able to perform the conversion using phpMyAdmin:

drupal_cache_* (any tables that start with this need conversion)
drupal_variable

Regarding the above example table names. If you didn't do a Media Temple 1-click install originally, your table prefixes are probably not "drupal_".

stoptime’s picture

I changed these tables right from phpMyAdmin - seems to be working, I can actually flush the cache now. Disabling the admin overlay also generally helped with performance.

pipep’s picture

thanks mate, worked for me too.

so4’s picture

Worked for me. I changed the entire DB to MyISAM.

Jasonrj’s picture

I am with Media Temple as well, and unfortunately changing the database and using their 1-click install that is supposed to setup the database correctly did not work.

I receive less errors, but still receive them. I don't want any unnecessary errors, so I will be regretfully switching hosts today. Too bad, I love Media Temple, but I need a host that can handle a basic Drupal install for a low-traffic site. Media Temple can't handle that without putting you onto a dedicated environment for some reason.

mcfilms’s picture

I think MT staff and service are amazing. They were also gracious hosts of the monthly LA Drupal meet-up.

However I agree that there are some technical difficulties with their current grid architecture and Drupal 7. Personally I think it would be a good move for them to automatically grant any user with the above issue a "mySql container". Trying to upsell a customer to this service does not work, it drives customers to another provider.

Just my unsolicited 2¢.

A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com

tmsimont’s picture

the commerce tables also seem to have issues on Media Temple. I would strongly recommend against using Media Temple at all if you plan on running a Drupal site. Their "one click install" version of Drupal is out of date, and you won't be able to run updates or a large bit of contrib modules.

Anonymous’s picture

the problem is media temple, they use MySQL Engines: MyISAM and drupal is designed to use InnoDB..
Media temple uses MyISAM To save memory.. don't ask me why they are being cheap... but they are offering the same service as, lets say GoDaddy and charging the customer premium price. that is a rip off if you ask me.

webbroidrupal’s picture

So Everyone including myself who uses MediaTemple is freaking out because Godaddy acquired Media Temple. I bet they probably had the entire PR team at Godaddy working overtime just to respond to all the people wanting to leave. This is their official response. Just read a few of the comments and you will get the gist of the sentiment. SOAPA, Spam Marketing, Poor UI, the list goes on why developers choose media temple over Godaddy. They really are on opposite ends of the spectrum literally the antithesis of each other.

I won't continue to rant on..I'm sure you all get my point. Now to the upside. This now gives those of you the opportunity to find another company to replace mediatemple for your drupal hosting. There are many option out there in the PAAS hosting space. Amazon EC2, Rackspace, and many others. I would encourage you all to check out Pantheon, for your drupal Hosting needs. You will find that accross the board its going to be a better experience. The official marketing jargon is: Cut the ties that bind you to physical servers. Pantheon’s all-in-one platform gives Drupal developers everything they need to build, launch, and run solid websites. This is true. You won't have to deal with servers anymore. And their support is amazing.