{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/13237","labels_url":"https://api.github.com/repos/owncloud/core/issues/13237/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/13237/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/13237/events","html_url":"https://github.com/owncloud/core/issues/13237","id":53954389,"number":13237,"title":"Slow searches after upgrading from 6.0.6 to 7.0.4, Server CPU load peaks at 100% while searching","user":{"login":"legnabar","id":10474615,"avatar_url":"https://avatars.githubusercontent.com/u/10474615?v=3","gravatar_id":"","url":"https://api.github.com/users/legnabar","html_url":"https://github.com/legnabar","followers_url":"https://api.github.com/users/legnabar/followers","following_url":"https://api.github.com/users/legnabar/following{/other_user}","gists_url":"https://api.github.com/users/legnabar/gists{/gist_id}","starred_url":"https://api.github.com/users/legnabar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legnabar/subscriptions","organizations_url":"https://api.github.com/users/legnabar/orgs","repos_url":"https://api.github.com/users/legnabar/repos","events_url":"https://api.github.com/users/legnabar/events{/privacy}","received_events_url":"https://api.github.com/users/legnabar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/app%3Asearch","name":"app:search","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/owncloud/core/labels/Performance","name":"Performance","color":"fbca04"},{"url":"https://api.github.com/repos/owncloud/core/labels/Regression","name":"Regression","color":"e11d21"},{"url":"https://api.github.com/repos/owncloud/core/labels/Update","name":"Update","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-10T10:57:12Z","updated_at":"2015-01-10T13:37:55Z","closed_at":null,"body":"Hello eveybody,\r\n\r\nBefore start, as this is my first post, I would like to thank all the developers for the awesome work with Owncloud, it's a wonderful software.\r\n\r\nI came across a weird issue after the migration from an stable and rock solid deployment based on OC 6.0.6 with 300 users and LDAP integration. The Search app in the web, which had always been blazing fast (I'm not using lucent search so far) is now sluggish (I.e: one search takes more than  7 seconds to draw results in a user account with less than 300 files on it), to the point that with those users with more files in their accounts the issue gets worse and no results are displayed and which is worst, during this search task, Apache processes takes up the whole CPU, up to 100% thus degrading the performance of the whole installation.\r\n\r\nI did lot of testing on my own before posting this issue here: For example, the issue only appears with existent users migrated from 6.x version then, if I create a new user within OC 7.0.4 and copy over the same files from another existent user with lot of files, the search works as expected (within a second) and the CPU doesn't peak. Therefore, I assume that may have something to do with the upgrade process and something that is not well updated somewhere in the DB, causing the issue.\r\n\r\nThere is nothing relevant in the logs and the upgrade process completed successfully. I have also checked that downgrading to 6.0.6 solves the issue.\r\n\r\nI would appreciate it if you could have a look at this issue and let me know of any possible solution for this.\r\n\r\nIf you need further information please let me know.\r\n\r\nThank you in advance.\r\n\r\nKind Regards,\r\n\r\n### Steps to reproduce\r\n1.Login to OC with a user migrated from OC 6 and enter any pattern to search in the search box\r\n2.The search takes too long (several seconds) to complete or even never finish.\r\n3.While the search task is running the CPU on the server remains at 100% due to apache processes.\r\n\r\n### Expected behaviour\r\nAs in OC 6, the search should complete within a second or two and should not affect severely the performance on the server, with the CPU at 100%.\r\n\r\n### Actual behaviour\r\nThe search, specially with the users with most files, takes too long to complete or never ends and while launching it the CPU on the server peaks due to Apache process.\r\n\r\n### Server configuration\r\n**Operating system**: Ubuntu 14.04.1 LTS\r\n\r\n**Web server:** Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f\r\n\r\n**Database:** Mysql 5.5.40-0ubuntu0.14.04.1 (Ubuntu)\r\n\r\n**PHP version:** 5.5.9-1ubuntu4.5\r\n\r\n**ownCloud version:**  OC 7.0.4\r\n\r\n**Updated from an older ownCloud or fresh install:**\r\n  UPDATED FROM 6.0.6\r\n\r\n**List of activated apps:**\r\nEnabled:\r\n - activity\r\n - documents\r\n - files\r\n - files_external\r\n - files_pdfviewer\r\n - files_sharing\r\n - files_texteditor\r\n - files_trashbin\r\n - files_versions\r\n - gallery\r\n - user_ldap\r\n\r\n**The content of config/config.php:**\r\n```php\r\n<?php\r\n$CONFIG = array (\r\n  'instanceid' => 'XXXX-OMITTED-XXXXX,\r\n  'theme' => 'custom',\r\n  'passwordsalt' => 'XXXX-OMITTED-XXXXX,\r\n  'datadirectory' => '/owncloud/data',\r\n  'dbtype' => 'mysql',\r\n  'version' => '7.0.4.2',\r\n  'dbname' => 'XXXX-OMITTED-XXXXX,\r\n  'dbhost' => 'localhost',\r\n  'dbtableprefix' => 'oc_',\r\n  'dbuser' => '',XXXX-OMITTED-XXXXX\r\n  'dbpassword' => '',\r\n  'installed' => true,\r\n  'ldapIgnoreNamingRules' => false,\r\n  'mail_smtpmode' => 'smtp',\r\n  'mail_smtphost' => 'XXXX-OMITTED-XXXXX',\r\n  'mail_smtpauth' => false,\r\n  'loglevel' => '1',\r\n  'maintenance' => false,\r\n  'enable_previews' => true,\r\n  'preview_max_x' => NULL,\r\n  'preview_max_y' => NULL,\r\n  'enable_avatars' => true,\r\n  'knowledgebaseenabled' => false,\r\n  'trusted_domains' => \r\n  array (\r\n    0 => 'XXXX-OMITTED-XXXXX',\r\n  ),\r\n  'secret' => 'XXXXX-OMITTED-XXXXXX'\r\n  'share_folder' => '/Shared',```\r\n\r\n````\r\n\r\n**Are you using external storage, if yes which one:** \r\nNO\r\n**Are you using encryption:** \r\nNO\r\n### Client configuration\r\n**Browser:* Google Chrome*"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/69455987","html_url":"https://github.com/owncloud/core/issues/13237#issuecomment-69455987","issue_url":"https://api.github.com/repos/owncloud/core/issues/13237","id":69455987,"user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"created_at":"2015-01-10T13:37:55Z","updated_at":"2015-01-10T13:37:55Z","body":"(Please note that I'm on my mobile right now and so the actual process might sligthly differ from my brain notices ;-))"}}