Hi, My site is increadibly slow at times (3 mins to load a news article page) and then at other times the same pages can be very quick to load, then slow again. I'm not a programmer but I installed the Devel module to attempt to understand what was causing it.

I have the query logs sorted in order of slowest loading time. I refreshed the page expecting to see the same slow queries at the top of the query log but there were completely different queries with slow load times.

The slowest query I experienced took 26583.74ms to load! which was to do with lock_acquire 'INSERT INTO semaphore (name, value, expire) VALUES (: db_insert_placeholder_0, : db_insert_placeholder_1, : db_insert_placeholder_2)

because the speed of the database queries aren't consistant and its different queries that are experiencing slow performance, do you think this is an issue with the database? If so what can I do to speed it up (i'm on a shared host by the way)?

Comments

jaypan’s picture

Try optimizing your database tables. Check if they need repairing as well.

Contact me to contract me for D7 -> D10/11 migrations.

phatmike10’s picture

Ok, how do I do that? Would the DB Maintenance Module do the job?

dbeall’s picture

There is a lot of neat functions in phpmyadmin. If I remember correctly, you can click the database on the left side, which will list all tables on the right side,, then down at the bottom, choose select all,, then use the drop down select list to choose optimize and do it another time to repair tables..

be careful not to choose "drop", "empty", or "trunicate" from the select list..

dbeall’s picture

I use Boost, since I know the developer is very good at his craft and it just works.

Boost creates a flat-file-cache to avoid hitting the database for anonymous users, or not logged in.

It grabs a copy of each page as they are requested from the database, then keeps that copy in the cache file for the next request.. The only thing you have to do is install it, set it, grab some htaccess rules from the BOOST admin page, paste the rules into your htaccess at the root of your drupal install, and sit back, enjoy the speed.

http://drupal.org/project/boost

phatmike10’s picture

great thanks, I will try both of these.

phatmike10’s picture

Hi I tried the 'optimize' in Myphpadmin and it didn't work because the tables are innodb. how do I do I perform 'optimize' and 'repair' for innodb?

heretic381’s picture

Hi,
is there anything new about this issue, cause my site has exactly the same problem. Page load time has huge fluctuations because of lock_acquire and lock_release, that can come several time on the same page with load time going from hundreds of ms to several seconds. This is really annoying, can't find any info about the issue and how to resolve it.

phatmike10’s picture

sorry for the late reply but what fixed it for me was changing all my database tables to myisam as opposed to innodb as my host didn't support innodb