Our Drupal site is sslllooooowwwww, at best taking 3s for static-content pages, at worst 11s for shopping cart pages. Above is the profile for visiting the shopping cart. Profiling reveals that PDOStatement::execute is the #1 time consumer. Any advice why or what to do about it?

Not sure if indicator that my connection has problems, Drupal is inefficiently sending data, or if it's time to learn how to tweak MySql.

  • I cannot decipher anything in your screenshot. – user7667 Jul 13 '12 at 17:33
  • The image is now a link to the fullscreen image. – kiamlaluno Jul 13 '12 at 17:55

I suggest that you use the Devel module to debug this. You can turn on query logging in its option to list all the queries used in the display of the page and go from there. I would also try running the site on a different server - perhaps a dev server with plenty of resources - and see how it performs there. I would also check your syslog and mysql logs to see if there are any warnings there for you to consider or if your server is running out of resources.

  • Thank you for answering the What To Do About It. Running it on another server (well, another host altogether) did solve the problem. It was an issue with the speed of my hosting company and their MySql servers. They hosted their MySql databases on a server separate from my VPS server, and the connection between them was not fast at all. Switching to a hosting company that hosted everything together (and a shared hosting server at that) boosted speed tremendously. – Daniel R. Aug 13 '12 at 20:56

It could mean any of a bunch of things. PDOStatement::execute() is just the final method that gets called for each and every database query Drupal makes (which can be quite a few).

First, make sure you Apache is configured properly, and that APC is installed and has enough memory.

Then, I would make sure your MySQL instance has a decent starting point. Download, run, and follow the advice of mysqltuner.

Then, download/install/enable the Performance Logging and Monitoring module and play around with the reports.

Figure out what is slow, and fix it.

There are also bunches of posts with other profiling advice, too, as well as advice for performance improvements beyond basic configuration (eg, advanced caching strategies).

  • Thanks for the input. I'll look into it and report back here. – Daniel R. Jul 13 '12 at 17:09
  • Thank you for answering the Why. You explained that the command was about databases queries and I followed your suggestions, and although they didn't fix it, my problem was due to a database connection problem. So thanks for pointing me in the right direction, toward the database. – Daniel R. Aug 13 '12 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.