Commit Graph

10 Commits

Author SHA1 Message Date
Yorick Peterse 97731760d7
Re-organize queues to use for Sidekiq
Dumping too many jobs in the same queue (e.g. the "default" queue) is a
dangerous setup. Jobs that take a long time to process can effectively
block any other work from being performed given there are enough of
these jobs.

Furthermore it becomes harder to monitor the jobs as a single queue
could contain jobs for different workers. In such a setup the only
reliable way of getting counts per job is to iterate over all jobs in a
queue, which is a rather time consuming process.

By using separate queues for various workers we have better control over
throughput, we can add weight to queues, and we can monitor queues
better. Some workers still use the same queue whenever their work is
related. For example, the various CI pipeline workers use the same
"pipeline" queue.

This commit includes a Rails migration that moves Sidekiq jobs from the
old queues to the new ones. This migration also takes care of doing the
inverse if ever needed. This does require downtime as otherwise new jobs
could be scheduled in the old queues after this migration completes.

This commit also includes an RSpec test that blacklists the use of the
"default" queue and ensures cron workers use the "cronjob" queue.

Fixes gitlab-org/gitlab-ce#23370
2016-10-21 18:17:07 +02:00
Yorick Peterse d345591fc8
Tracking of custom events
GitLab Performance Monitoring is now able to track custom events not
directly related to application performance. These events include the
number of tags pushed, repositories created, builds registered, etc.

The use of these events is to get a better overview of how a GitLab
instance is used and how that may affect performance. For example, a
large number of Git pushes may have a negative impact on the underlying
storage engine.

Events are stored in the "events" measurement and are not prefixed with
"rails_" or "sidekiq_", this makes it easier to query events with the
same name triggered from different parts of the application. All events
being stored in the same measurement also makes it easier to downsample
data.

Currently the following events are tracked:

* Creating repositories
* Removing repositories
* Changing the default branch of a repository
* Pushing a new tag
* Removing an existing tag
* Pushing a commit (along with the branch being pushed to)
* Pushing a new branch
* Removing an existing branch
* Importing a repository (along with the URL we're importing)
* Forking a repository (along with the source/target path)
* CI builds registered (and when no build could be found)
* CI builds being updated
* Rails and Sidekiq exceptions

Fixes gitlab-org/gitlab-ce#13720
2016-08-17 10:04:04 +02:00
Alejandro Rodríguez 1dcfb1d3a7 Fix a bug where forking a project from a repository storage to another would fail 2016-07-26 17:22:13 -04:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
James Lopez 64c3905523 some refactoring and fixing spec 2016-06-02 21:48:25 -04:00
Yorick Peterse 68a4c98f50 Cache output of Repository#exists?
This caches the output of Repository#exists? in Redis while making sure
it's flushed properly when creating new repositories, deleting them,
etc.

For the ProjectWiki tests to work I had to make ProjectWiki#create_repo!
public as testing private methods in RSpec is a bit of a pain.
2016-03-19 21:54:08 +01:00
Yorick Peterse ff28a7cc36 Moved cache expiration code to Repository hooks
This keeps all the cache expiration code in a single file/class instead
of spreading it all across the codebase.
2016-02-23 12:02:59 +01:00
Yorick Peterse a9e0301c23 Expire caches after forking/importing a repository
This ensures the caches for Repository#empty? and
Repository#has_visible_content? are flushed after a repository has been
imported or forked.

Fixes gitlab-org/gitlab-ce#13505
2016-02-17 11:38:18 +01:00
Douwe Maan 841a7c6897 Store and show reason why import failed. 2015-11-18 12:00:56 +01:00
Stan Hu 9995f0806b Import forked repositories asynchronously to prevent large repositories from timing out
Use import_status to track async import status and give feedback to the user

Closes #2388
Closes #2400
2015-09-11 00:34:04 -07:00