'Git pre-receive hooks performance issues [closed]
Currently I am using pre-receive hooks in the GitLab server for validating all the files that are pushed
- But I want to know if the pre receive hooks will cause any performance issue??
- **What are the drawbacks/when should we avoid using server side hooks in gitlab **
Is there anyways to check performance issues on gitlab server
Solution 1:[1]
It's really hard to say whether a given set of pre-receive hooks will cause performance problems. To know for certain, you would need to set up a test instance and test with representative workloads for your instance. What might be a problem on pushes of thousands of commits on a small server would probably be fine with small pushes on a very powerful server.
However, in many cases, it can be helpful to avoid pre-receive hooks, which must run immediately before any push can be accepted, and instead choose to use some sort of protected branch and then check the code using a CI job. This doesn't need to run inline and can be run on another, more powerful system, and it likely will also give you a great deal more flexibility to perform different kinds of checks across different repositories. It can also end up providing more helpful responses for the person pushing code by allowing them to inspect logs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | bk2204 |