MySQL Sleeping Process/High CPU Usage

A while ago I decided to rebuild my web server on a new VM running in Hyper-V. I ported over a Concrete5 site along with OwnCloud, which I use for accessing a local file server. After starting Apache I noticed that the Owncloudsite would function normally, then after an as of yet unknown time had passed, the page would refuse to load or logging in would hang. I then noticed that when this happens, the load on the cpu (checked using top) was at nearly 4.00 on a two core vm. I have reinstalled both the vm and OwnCloud from scratch, including using the newest version (9.1.3), but the issue is repeated, as it was with the older OwnCloud.

Steps to reproduce
1. Go to OwnCloud page or attempt to log in
2. Page will hang, upon checking processlist for mysql, a sleeping oc process will be there, and load on CPU will spike to above 100
3. Restarting mysql will remove process, but the issue is repeated.

Expected behaviour
Owncloud should load properly, as happened in the past.

Server configuration
Operating system: Debian 8
Web server: Apache2
Database: MySQL 14.14 Dist 5.5.53
PHP version: 5.6.29
ownCloud version (see ownCloud admin page): 9.1.3
Updated from an older ownCloud or fresh install:
Special configuration (external storage, external authentication, reverse proxy, server-side-encryption):
The data folder, as well as three other folders used by owncloud, are mounted to Debian using CIFS.

ownCloud log (data/owncloud.log)

{"reqId":"Xg25zASMVhH\/1WB78rqc","remoteAddr":"","app":"PHP","message":"fwrite(): send of 1028 bytes failed with errno=32 Broken pipe at \/var\/www\/html\/apps\/files_antivirus\/lib\/scanner.php#67","level":3,"time":"November 16, 2016 09:50:25","method":"--","url":"--","user":"MioUtente"}
{"reqId":"Xg25zASMVhH\/1WB78rqc","remoteAddr":"","app":"PHP","message":"fwrite(): send of 1028 bytes failed with errno=32 Broken pipe at \/var\/www\/html\/apps\/files_antivirus\/lib\/scanner.php#67","level":3,"time":"November 16, 2016 09:50:25","method":"--","url":"--","user":"MioUtente"}
{"reqId":"Xg25zASMVhH\/1WB78rqc","remoteAddr":"","app":"PHP","message":"fwrite(): send of 1028 bytes failed with errno=32 Broken pipe at \/var\/www\/html\/apps\/files_antivirus\/lib\/scanner.php#67","level":3,"time":"November 16, 2016 09:50:25","method":"--","url":"--","user":"MioUtente"}

Integrity status for oC9+

No errors have been found.

Additional information:
- Mysql logs the slow queries in the following way:

/usr/sbin/mysqld, Version: 5.5.53-0+deb8u1-log ((Debian)). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
/usr/sbin/mysqld, Version: 5.5.53-0+deb8u1-log ((Debian)). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument

The error is related to the antivirus app, can you disable this app and see if it works? Can you double check your php version?

Can you specify the antivirus app you're referring to? The VM does not have any explicitly installed antivirus software, and as a test I disabled Avast on a client computer to no effect.

The post has been updated with the current specifications of the VM I am working in, which replicate the original issue verbatim.

Should be in the apps-section of the owncloud interface.

"Antivirus App for files" has never been enabled, and is currently located in the "Not enabled" category in Apps. After monitoring the VM for a bit I'm thinking the issue may reside in CIFS, rather than OwnCloud. It would appear after X minutes the Windows SMB shares I have mounted using cifs-utils appear to time out, and terminal hangs when attempting to 'ls' or 'cd' the directories. Since OwnCloud has these shares mounted as external storage, could it be possible that it hangs when trying to establish a connection with them?

As a test I created a cron task that creates the same new file in a subfolder of the shares every 5 minutes, and for a day and a half OwnCloud has not hung on the login screen.

That's kind of a hint and the broken pipe makes kind of sense. However, it's not clear why it fails with some code of the antivirus-app which is not enabled. You should open a bug report on github.com/owncloud/core/issues and ask for clarification why the antivirus-app creates this error.