Simulating GitLab Activity

Simulating GitLab Activity

Table of Contents

Self-hosted GitLab instances are critical infrastructure for many organizations. While setting up GitLab is straightforward, operating it at scale requires deep understanding of its behavior under real-world conditions. This is where user activity simulation can become invaluable.

Developing Robust Observability

Simulated user activity provides consistent, predictable load patterns that help establish monitoring baselines. By generating merge requests, CI pipeline runs, and repository operations at controlled rates, teams can:

  • Validate metrics collection and visualization across GitLab components
  • Identify performance bottlenecks before they impact production
  • Test alerting thresholds against known activity patterns
  • Measure resource utilization across different load profiles

The predictable nature of simulated traffic makes it easier to spot anomalies and verify monitoring system effectiveness.

Disaster Recovery Testing

Regular disaster recovery testing is essential but risky in production environments. With simulated users, teams can safely:

  • Test component failover mechanisms
  • Validate backup and restoration procedures
  • Measure recovery time objectives (RTO) under realistic conditions
  • Practice incident response procedures
  • Verify data consistency after recovery

The controlled environment allows teams to iterate on recovery procedures without impacting real users.

New User Training

Simulated activity creates a rich, interactive environment for training:

  • New team members can observe realistic GitLab workflows
  • Training exercises can include responding to common issues
  • Documentation can reference concrete examples
  • Users can practice administrative tasks safely
  • Teams can experiment with GitLab features and integrations

This hands-on experience accelerates learning while eliminating risk to production systems.

Performance Optimization

Understanding performance characteristics requires consistent, reproducible workloads. Simulation enables:

  • A/B testing of configuration changes
  • Capacity planning for growth
  • Database optimization and tuning
  • Load balancer configuration validation
  • Resource allocation decisions

The ability to generate specific traffic patterns helps teams optimize with confidence.

How to Simulate User Activity

GitLab API

The GitLab API comprehensively supports the user actions that make up the daily activity on a GitLab installation. These include repository creation, cloning, pushing changes as well as creating and dealing with merge requests or issues.

As well as using the native API calls, there are higher-level libraries such as the excellent python-gitlab which makes it easy to script relatively complicated actions and perform them on a scheduled basis.

A Simple Example

A very common repository activity would be a developer submitting a merge-request, and another developer subsequently accepting or closing the MR.

We can do simulate this by running a script with two threads:

  • Thread 1 : sleep for a random delay, then select a project, update the README.md and create an MR, repeat
  • Thread 2 : sleep for a random delay, select an open MR, either accept or close it, repeat

Some python code implementing this can be found here: https://gitlab.com/toastermagic/gitlab-activity-simulator

Implementation Considerations

When implementing user simulation:

Create realistic workflow patterns that match your organization’s usage Include both regular and burst traffic patterns Simulate across all major GitLab features: git operations, CI/CD, merge requests, etc. Monitor system impact of the simulation itself Maintain separation between simulated and production traffic

Conclusion

User activity simulation transforms GitLab operation from reactive to proactive. It provides a foundation for continuous improvement while reducing risk. For teams running business-critical GitLab instances, it’s an essential tool for maintaining reliability and performance.

Related Posts

Token-Zero: When you need a token to create a token

Token-Zero: When you need a token to create a token

When automating a GitLab installation, you’ll often need to create “token zero” - the first access token used to bootstrap your automation processes. Unlike the initial root password, this token is specifically scoped for API interactions during setup. This creates a chicken-and-egg situation: you need a token to make API calls, but you need to make an API call to create a token.

Building a Blog with Hugo and GitLab Pages

Building a Blog with Hugo and GitLab Pages

Setting up a personal blog doesn’t have to be expensive or complicated. In this guide, I’ll walk you through creating and hosting a blog using Hugo (a fast static site generator) and GitLab Pages (free hosting) - complete with a custom domain name and SSL certificate. The best part? Outside of the cost of a domain name it’s completely free!

A New Blog

A New Blog

I’ve finally taken the plunge and committed to sharing my DevOps experiences through this new blog. After years of wrestling with pipelines, debugging deployment issues, and celebrating those sweet moments when everything just clicks, I figured it’s time to give something back to the community that has taught me so much. I’ll be sharing both the wins and the “learning opportunities” (aka the times things went spectacularly wrong) that come with working in DevOps.