Timeout and slow processing on search requests
Created by: sennav
-
Summary: The search request for a specific project takes too long or it timeout.
-
Steps to reproduce: Just select one project (gitlaburl.com/project_id) and search for something on the search box. The search from the dasboard works fine
-
Expected behavior: The expected behavior is to get the search results. After the upgrade to version 7.4, the search always returned error 500. I've noticed that the unicorn worker were restarted after the request. So I increased the timeout to 120 seconds on
config/unicorn.rb
. The requests are taking 1 min to finish now. I've also noticed that in gitlab.com the requests are quite faster, so I don't know if I'm missing something on configuration files. -
Observed behavior: Timeout.
-
Relevant logs and/or screenshots: This is the log of one request after I changed the timeout to 120 seconds:
Started GET "/search?utf8=%E2%9C%93&search=test&group_id=&project_id=28&search_code=true&repository_ref=" for 127.0.0.1 at 2014-10-21 17:12:23 -0200 Processing by SearchController#show as HTML Parameters: {"utf8"=>"✓", "search"=>"test", "group_id"=>"", "project_id"=>"28", "search_code"=>"true", "repository_ref"=>""} Completed 200 OK in 75798ms (Views: 37594.5ms | ActiveRecord: 25.4ms) Started GET "/project/notes?target_id=234&target_type=issue&last_fetched_at=1413918728" for 127.0.0.1 at 2014-10-21 17:13:28 -0200 Processing by Projects::NotesController#index as JSON Parameters: {"target_id"=>"234", "target_type"=>"issue", "last_fetched_at"=>"1413918728", "project_id"=>"project"} Completed 200 OK in 29ms (Views: 0.2ms | ActiveRecord: 6.0ms) Started POST "/api/v3/internal/allowed" for 127.0.0.1 at 2014-10-21 17:13:28 -0200 Started GET "/project/notes?target_id=234&target_type=issue&last_fetched_at=1413918728" for 127.0.0.1 at 2014-10-21 17:13:29 -0200 Processing by Projects::NotesController#index as JSON Parameters: {"target_id"=>"234", "target_type"=>"issue", "last_fetched_at"=>"1413918728", "project_id"=>"project"} Completed 200 OK in 319ms (Views: 0.4ms | ActiveRecord: 19.7ms) Started GET "/project/notes?target_id=234&target_type=issue&last_fetched_at=1413918728" for 127.0.0.1 at 2014-10-21 17:13:29 -0200 Processing by Projects::NotesController#index as JSON Parameters: {"target_id"=>"234", "target_type"=>"issue", "last_fetched_at"=>"1413918728", "project_id"=>"project"} Completed 200 OK in 32ms (Views: 0.2ms | ActiveRecord: 5.9ms) Started GET "/project/notes?target_id=234&target_type=issue&last_fetched_at=1413918728" for 127.0.0.1 at 2014-10-21 17:13:29 -0200 Processing by Projects::NotesController#index as JSON Parameters: {"target_id"=>"234", "target_type"=>"issue", "last_fetched_at"=>"1413918728", "project_id"=>"project"} Completed 200 OK in 30ms (Views: 0.2ms | ActiveRecord: 5.9ms) Started GET "/project/notes?target_id=234&target_type=issue&last_fetched_at=1413918728" for 127.0.0.1 at 2014-10-21 17:13:29 -0200 Processing by Projects::NotesController#index as JSON Parameters: {"target_id"=>"234", "target_type"=>"issue", "last_fetched_at"=>"1413918728", "project_id"=>"project"} Completed 200 OK in 29ms (Views: 0.2ms | ActiveRecord: 5.7ms) Completed 200 OK in 67899ms (Views: 36228.1ms | ActiveRecord: 23.3ms)
-
Output of checks: Results of GitLab Application Check (sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true);
Checking Environment ... Git configured for git user? ... yes Checking Environment ... Finished Checking GitLab Shell ... GitLab Shell version >= 2.0.1 ? ... OK (2.0.1) Repo base directory exists? ... yes Repo base directory is a symlink? ... no Repo base owned by git:git? ... yes Repo base access is drwxrws---? ... yes Satellites access is drwxr-x---? ... yes hooks directories in repos are links: ... 5/25 ... ok [...] Running /home/git/gitlab-shell/bin/check Check GitLab API access: OK Check directories and files: /home/git/repositories: OK /home/git/.ssh/authorized_keys: OK Test redis-cli executable: redis-cli 2.2.12 Send ping to redis server: PONG gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Sidekiq ... Running? ... yes Number of Sidekiq processes ... 1 Checking Sidekiq ... Finished Checking LDAP ... LDAP users with access to your GitLab server (only showing the first 100 results) [ommited] Checking LDAP ... Finished Checking GitLab ... Database config exists? ... yes Database is SQLite ... no All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Init script exists? ... yes Init script up-to-date? ... yes projects have namespace: ... 5/25 ... yes [...] Projects have satellites? ... 5/25 ... yes [...] Redis version >= 2.0.0? ... yes Ruby version >= 2.0.0 ? ... yes (2.1.2) Your git bin path is "/usr/bin/git" Git version >= 1.7.10 ? ... no Try fixing it: Update your git to a version >= 1.7.10 from 1.7.9 Please fix the error above and rerun the checks. Checking GitLab ... Finished
Version of GitLab running: SHA commit 536f61e0
Setup:
System information System: Ubuntu 12.04 Current User: git Using RVM: no Ruby Version: 2.1.2p95 Gem Version: 2.2.2 Bundler Version:1.7.4 Rake Version: 10.3.2 Sidekiq Version:2.17.0 GitLab information Version: 7.4.0.rc1 Revision: 536f61e Directory: /home/git/gitlab DB Adapter: mysql2 URL: http://gitlab HTTP Clone URL: http://gitlab/some-project.git SSH Clone URL: git@gitlab:some-project.git Using LDAP: yes Using Omniauth: no GitLab Shell Version: 2.0.1 Repositories: /home/git/repositories/ Hooks: /home/git/gitlab-shell/hooks/ Git: /usr/bin/git
-
Possible fixes: I really hope that I can help you on this, but I have to get some time to learn through all your guides and code. Please let me know if this issue doesn't comply with your contributing guidelines. Thanks for all your work anyway.