Gitlab Timeout Issue (Self Hosted)

Hi,

we are using gitlab Omnibus version 13.+ and our VM machine specs are
2vCPU, 8GB Ram, 1TB storage .

we have often faced timeout and slowness issue with gitlab which was not the issue in very start but with time we are facing this issue quite consistently.

we have other other services installed too on this machine that means . CPU and memory are shared with other services too. here is the complete error trace we found in gitlab logs when it timeouts.

Also we have default configurations set provided with Gitlab installation.

* "exception.class":"Rack::Timeout::RequestTimeoutException",
* "exception.message":"Request ran for longer than 60000ms",
* "exception.backtrace":[
  1. "app/models/concerns/cache_markdown_field.rb:162:in `block in cache_markdown_field'",
  2. "app/models/concerns/cache_markdown_field.rb:90:in `attribute_invalidated?'",
  3. "app/models/concerns/cache_markdown_field.rb:86:in `block in invalidated_markdown_cache?'",
  4. "app/models/concerns/cache_markdown_field.rb:86:in `any?'",
  5. "app/models/concerns/cache_markdown_field.rb:86:in `invalidated_markdown_cache?'",
  6. "lib/gitlab/timeless.rb:12:in `timeless'",
  7. "app/models/merge_request.rb:195:in `block (2 levels) in <class:MergeRequest>'",
  8. "app/services/merge_requests/mergeability_check_service.rb:123:in `update_merge_status'",
  9. "app/services/merge_requests/mergeability_check_service.rb:61:in `check_mergeability'",
  10. "app/services/merge_requests/mergeability_check_service.rb:49:in `block in execute'",
  11. "lib/gitlab/exclusive_lease_helpers.rb:38:in `in_lock'",
  12. "app/services/merge_requests/mergeability_check_service.rb:91:in `in_write_lock'",
  13. "app/services/merge_requests/mergeability_check_service.rb:43:in `execute'",
  14. "app/models/merge_request.rb:883:in `check_mergeability'",
  15. "app/models/merge_request.rb:921:in `mergeable?'",
  16. "ee/app/models/ee/merge_request.rb:107:in `mergeable?'",
  17. "app/serializers/merge_request_poll_cached_widget_entity.rb:18:in `block in <class:MergeRequestPollCachedWidgetEntity>'",
  18. "app/serializers/base_serializer.rb:16:in `represent'",
  19. "app/serializers/merge_request_serializer.rb:27:in `represent'",
  20. "ee/app/serializers/ee/merge_request_serializer.rb:15:in `represent'",
  21. "app/controllers/projects/merge_requests/content_controller.rb:37:in `serializer'",
  22. "app/controllers/projects/merge_requests/content_controller.rb:24:in `block (2 levels) in cached_widget'",
  23. "app/controllers/projects/merge_requests/content_controller.rb:22:in `cached_widget'",
  24. "app/controllers/application_controller.rb:552:in `block in allow_gitaly_ref_name_caching'",
  25. "lib/gitlab/gitaly_client.rb:355:in `allow_ref_name_caching'",
  26. "app/controllers/application_controller.rb:551:in `allow_gitaly_ref_name_caching'",
  27. "ee/lib/gitlab/ip_address_state.rb:10:in `with'",
  28. "ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address'",
  29. "app/controllers/application_controller.rb:497:in `set_current_admin'",
  30. "lib/gitlab/session.rb:11:in `with_session'",
  31. "app/controllers/application_controller.rb:488:in `set_session_storage'",
  32. "app/controllers/application_controller.rb:482:in `set_locale'",
  33. "lib/gitlab/error_tracking.rb:51:in `with_context'",
  34. "app/controllers/application_controller.rb:547:in `sentry_context'",
  35. "app/controllers/application_controller.rb:475:in `block in set_current_context'",
  36. "lib/gitlab/application_context.rb:52:in `block in use'",
  37. "lib/gitlab/application_context.rb:52:in `use'",
  38. "lib/gitlab/application_context.rb:20:in `with_context'",
  39. "app/controllers/application_controller.rb:468:in `set_current_context'",
  40. "ee/lib/gitlab/jira/middleware.rb:19:in `call'"

Can someone pls help in identifying this issue ?

I can share more details if needed . Thank you

Hi, first, minimum requirements for gitlab are 4cpu. So you might want to think about increasing this if it is a virtual machine.