Skip to content
Snippets Groups Projects

Improve performance of creating projects

Merged yorickpeterse-staging requested to merge create-project-performance into master

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 94 94 @project.team << [current_user, :master, current_user]
    95 95 end
    96 96
    97 @project.update_column(:last_activity_at, @project.created_at)
  • @DouweM @yorickpeterse @rspeicher if we have performance problem with creating many services maybe we should change logic instead: create service only after user actually edited it and press save button? Each project has ~ 20 service objects created now even if it use 0 of it.

  • Maintainer

    I think that's a good idea because:

    1. It has a side benefit of allowing admins to configure the service templates and then activating the service with those templated settings even after the project has been created.
    2. Most projects don't need most of the services, so this spares the database of unnecessary rows.
  • @DouweM @yorickpeterse @rspeicher if we have performance problem with creating many services maybe we should change logic instead: create service only after user actually edited it and press save button? Each project has ~ 20 service objects created now even if it use 0 of it.

    I think this is a good idea.

  • Yep, makes sense to me.

  • if we have performance problem with creating many services maybe we should change logic instead: create service only after user actually edited it and press save button? Each project has ~ 20 service objects created now even if it use 0 of it.

    Sounds fine by me.

  • OK so to recap:

    1. Bulk insertion of services will be replaced with only inserting the services when the user actually activates them.
    2. The BulkInsertable concern will stay as it's still quite useful (especially for benchmarks that need lots of data).
    3. I'll keep the index/timestamp and other small changes in this MR since they are still useful on their own.

    What's not entirely clear to me is what needs to be done for step 1 other than (probably) removing Project#build_missing_services. Do we need to do anything extra at all?

    Edited by yorickpeterse-staging
  • Added 167 commits:

    • 135fffd8...ead3ffd7 - 163 commits from branch master
    • 7fc95d80 - Added index on services.template
    • 6369c992 - Added benchmark for Projects::CreateService
    • d155ed46 - Added concern for bulk inserting database rows
    • 4097e697 - Removed extra activity update for new projects
  • I'm going to scrap the BulkInsertable concern for the time being as well. Having tested it for some of my benchmarks it's not as useful as I thought. Inserting larger chunks of data doesn't seem to have any affect on my benchmarks, at the cost of (apparently) using quite a bit of CPU/memory (probably because it's not a super efficient implementation of bulk insertion).

    I'll rebase the concern out of this MR but keep it around separately in case I never need it again.

  • Added 1 commit:

    • 29b3ce56 - Removed extra activity update for new projects
  • For the services stuff I'll create a separate issue since I'm not really sure what has to be done exactly and what the impact would be (e.g. would users have to do anything extra). Is the rest good to go?

  • yorickpeterse-staging Title changed from WIP: improve performance of creating projects to Improve performance of creating projects

    Title changed from WIP: improve performance of creating projects to Improve performance of creating projects

  • yorickpeterse-staging Status changed to merged

    Status changed to merged

  • mentioned in commit 6d91ee00

  • mentioned in issue gitlab#3895

  • Please register or sign in to reply
    Loading