Closed (fixed)
Project:
Asynchronous Prefetch Database Query Cache
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2015 at 05:57 UTC
Updated:
25 Feb 2015 at 21:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mikeytown2 commentedCan you explain what the initial issues where so I can document this? What version of PHP are you using?
As for the error, it shouldn't happen; I'm scratching my head here. class APDQCache extends DrupalDatabaseCache which means if APDQCache doesn't define the method then that call gets passed along to DrupalDatabaseCache::isValidBin(). All I can say is that is a very very strange error to be getting. You should have gotten
Fatal error: Class 'DrupalDatabaseCache' not found, before you gotFatal error: Call to undefined method APDQCache::isValidBin().The DrupalDatabaseCache class is included first when looking at _drupal_bootstrap_page_cache() thanks to one of the top lines of code
DRUPAL_ROOT . '/includes/cache.inc';.I've uninstalled and reinstalled this multiple times on a couple of different servers; so I'm quite shocked to see you getting this error.
Comment #2
sk2013 commentedThanks for the response.
This is what I got when I ran the Reports after the module install:( So my server need some settings to be added / changed)
APDQC mysqli_reap_async_query
mysqli_reap_async_query() is disabled on this server. Please contact your hosting provider and see if they can re-enable this function for you.
Error
APDQC MYSQLI_ASYNC
MYSQLI_ASYNC is not available on this server. Please contact your hosting provider and see if they can make it available for you.
Warning
APDQC - Cache table collations Using the utf8_bin collation is faster and more accurate when matching cache ids since no unicode normalization is done to cache queries.
Go to the APDQC Operations page to change the cache tables to utf8_bin. This is a Drupal 8 backport.
Warning
APDQC - Cache table indexes In order to do smarter garbage collection of the cache bins, the purges are based on individual records timestamps; instead of just using the expire column, the created column is used as well. This allows for proper enforcement of the minimum cache lifetime.
Go to the APDQC Operations page to change the cache tables indexes.
Warning
APDQC - Database Connection The connection to the database could be faster.
Inside settings.php add this below the $databases array:
$databases['default']['default']['unix_socket'] = '/var/lib/mysql/mysql.sock';
Error
APDQC - MySQL innodb_buffer_pool_size Increase the innodb_buffer_pool_size. Current value: 128M; current database size: 303.5M
Find the MySQL configuration file (how to find it) and add and/or modify this line innodb_buffer_pool_size = 364.2M so it is at least 364.2M. The max size it should be is 8.7G
Warning
APDQC - MySQL query_cache_type query_cache_type should be OFF. Current value: ON.
Find the MySQL configuration file (how to find it) and add and/or modify this line query_cache_type = 0. More info: http://dom.as/tech/query-cache-tuner/
Warning
APDQC - MySQL semaphore table For older versions of MySQL (5.5 and lower) using the memory engine for the semaphore table is recommended.
Go to the APDQC Operations page to convert the semaphore table from InnoDB to MEMORY.
Warning
APDQC - PHP realpath_cache_size realpath_cache_size should be 128K at a minimum. Current value: 16K
Increase the realpath_cache_size value inside /usr/local/lib/php.ini. Will require a restart of PHP. Might need to increase this value again.
Warning
APDQC - PHP realpath_cache_ttl realpath_cache_ttl should be 3600 at a minimum. Current value: 120
Increase the realpath_cache_ttl value inside /usr/local/lib/php.ini. Will require a restart of PHP.
Comment #3
sk2013 commentedPHP Version 5.4.28
MySQL Client API version 5.5.40
Comment #4
mikeytown2 commentedYes, this module does require mysqli_reap_async_query() to be available & MYSQLI_ASYNC to be defined. Still doesn't explain the fatal though. Open to ideas there.
As for the rest of the things listed here, if you do them your server should be faster even without this module.
- Using the unix socket will help to speed up connections to the database.
- You need to increase the innodb_buffer_pool_size as your database is 300MB and you only gave MySQL 128MB; this means that you're swapping to disk, not good. I would up it to 1GB as it seems like you're on a server that has a decent amount of ram.
- Turning off the MySQL query cache is advised query_cache_type = 0
- You need to up the realpath_cache_size value. I check the size to see if it's full so this recommendation will keep going up until it's no longer full. 1M seems to be the average.
- Increasing the realpath_cache_ttl will help as well. Keep the paths to files in the cache longer.
Comment #5
sk2013 commentedMay be the error is due to MYSQLI_ASYNC is not defined in my server?
I will ask my Admin to update the server as per your recommendation and see any changes. Yes, I have 16GB RAM
Comment #6
mikeytown2 commentedMaybe.... anyway here's a patch that hopefully takes care of the fatal.
Contents of the patch is
If patching this by hand paste it in below the
public function isEmpty() {...}function and abovepublic function callCacheClearHooks($cid, $wildcard) {inside of the apdqc.cache.inc fileComment #7
sk2013 commentedI confirm this patch works.
Thanks again for your effort.
Comment #8
sk2013 commentedComment #9
mikeytown2 commentedUntil it has been committed please don't mark the issue as fixed or closed fixed. RTBC is a better option.
Comment #10
mikeytown2 commentedPatch from #6 has been committed.