Forum
MySQL Hanging when searching in assets
Hello,
I have a local install of perch running on apache on my local machine. I'm not using MAMP or Vagrant. I've uploaded a load of assets into the asset chooser, but when I try to search them, the server hangs and MySQL seems to crash, or hang or something. I'm then no longer able to browse around the admin dashboard as presumably mysql is trying to process the asset search.
I ran the following to view the MySQL processes: mysqladmin processlist -u root -p
which is showing the following:
+-----+------+-----------+------------+---------+------+------------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------+------------+---------+------+------------+------------------------------------------------------------------------------------------------------+
| 640 | root | localhost | wlwu_perch | Query | 208 | statistics | SELECT * FROM (SELECT r.*, MATCH(r.resourceTitle) AGAINST('golden') AS score, r2.resourceFile AS thu |
| 642 | root | localhost | | Query | 0 | starting | show processlist |
+-----+------+-----------+------------+---------+------+------------+------------------------------------------------------------------------------------------------------+
the process ID 640 seems to sleep or hang, or take a very long time to complete. I wondered if you'd encountered this before, or if you had any ideas why this might be happening? It could very likely be something to do with how mysql is set up on my machine?
My Diagnositc Report is as follows:
PERCH INFORMATION
Perch: 2.8.29
Production mode: Development (10)
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29)
DB driver: PDO
DB tables: perch2_categories (8), perch2_category_counts (0), perch2_category_sets (1), perch2_content_index (323), perch2_content_items (85), perch2_content_regions (3), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (0), perch2_pages (2), perch2_resource_log (132), perch2_resource_tags (5), perch2_resources (28), perch2_resources_to_tags (14), perch2_settings (10), perch2_user_passwords (0), perch2_user_privileges (26), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (1)
Users: 1
App runtimes:
<?php
$apps_list = array(
'content',
'categories'
);
Editor plug-ins: markitup, redactor
H1: 5f99221682d122cb9e23e537b329d609
L1: 56f00604ad2f915761ba262a4297d997
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.29: done
latest_version: 2.8.15
on_sale_version: 2.8.29
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_ENV: development
PERCH_PRODUCTION_MODE: 10
PERCH_DEBUG: 1
PERCH_SESSION_TIMEOUT_MINS: 1440
PERCH_DB_USERNAME: root
PERCH_DB_DATABASE: wlwu_perch
PERCH_DB_SERVER: localhost
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: mrtriangle@gmail.com
PERCH_EMAIL_FROM_NAME: Oliver Lowe
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/oliverlowe/Sites/wlwu/wwwroot/public/perch
PERCH_CORE: /Users/oliverlowe/Sites/wlwu/wwwroot/public/perch/core
PERCH_RESFILEPATH: /Users/oliverlowe/Sites/wlwu/wwwroot/public/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/oliverlowe/Sites/wlwu/wwwroot/public/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS
PHP: 5.6.17
Zend: 2.6.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.7.9
Free disk space: 301.35 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, json, ldap, mbstring, session, standard, mysqlnd, odbc, mysqli, PDO, pdo_mysql, PDO_ODBC, pdo_sqlite, Phar, posix, Reflection, mysql, shmop, SimpleXML, soap, sockets, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, apache2handler, apcu, mcrypt, mhash, apc, Zend OPcache
GD: Yes
ImageMagick: No
PHP max upload size: 16M
PHP max form post size: 16M
PHP memory limit: 512M
Total max uploadable file size: 16M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
HTTP_HOST: wlwu.dev
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 Safari/537.36
HTTP_DNT: 1
HTTP_REFERER: https://wlwu.dev/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,fr;q=0.6
HTTP_COOKIE: cmsa=1; __utma=74934484.2013364356.1462182441.1462218230.1462220949.7; __utmb=74934484.2.10.1462220949; __utmc=74934484; __utmz=74934484.1462182441.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); PHPSESSID=qlmck77h1ef53dtbuqr84ci301
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache/2.4.18 (Unix) PHP/5.6.17
SERVER_NAME: wlwu.dev
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: /Users/oliverlowe/Sites/wlwu/wwwroot/public
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: /Users/oliverlowe/Sites/wlwu/wwwroot/public
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/oliverlowe/Sites/wlwu/wwwroot/public/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 62680
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1462221576.16
REQUEST_TIME: 1462221576
PERCH_DB_DATABASE: wlwu_perch
PERCH_DB_USERNAME: root
PERCH_DB_PASSWORD: root
PERCH_ENV: development
Interestingly, the same thing is happening on another development site on my machine. It must be something to do with how I have MySQL setup on my local machine. Or possibly how to query is formatted?
This isn't something being reported by other users. We can't really help debug local setups, and I'd suggest using Vagrant to create a sandboxed local dev environment, it'll save you a lot of hassle!