Jenkins Master Horizontal Scaling - jenkins

Is there a way to horizontally scale Jenkins? We have a requirement where we can more number of jobs will be added and built every day. I understand we can distribute jobs to slaves and master should be only used for orchestrating. However, masters memory is also limited and we cant keep adding jobs, since master will have to maintain job details, history etc.
What if we have some 10000+ jobs running in parallel daily? Will we be able to scale Jenkins master?

Related

Jenkins master and slave node configuration

I am new to Jenkins and I have configured master-slave nodes as shown below, but I need help to configure the no of executors in each of the below slave nodes
Currently, I have configured 100 executors in each slave nodes
How many no of executors I can configure in each slave node and what fact(memory, RAM, etc) need to take consider when increasing the no of executors?
Maximum how many no of executors I can configure in each server?
Well it totally depends on your usage. There are multiple factors such as how much cpu and memory is available, how the build are going to execute and what kind of builds, how frequent these build should run etc. But I can clearly say that 100 is too big number. I would suggest go with 20 builds (if builds run frequently and have fair amount of CPU and memory) first and observe if is there any issue with numbers or not then you can increase accordingly.
here is very nice article check this out https://www.avantica.com/blog/jenkins-balance-load-master-slave-setup#:~:text=Jobs%20are%20built%20using%20executors,to%20build%20two%20different%20tasks.

How to limit concurrent matrix/multi-configuration builds in Jenkins

I have a multi-configuration job that uses a large amount of VMs for testing.
The Axis are something like:
30 VM slaves, 5 configurations, 5 different configurations
I would not like to run these sequentially, as the jobs would take forever. However, the default number of simultaneous runs is using up enough resources that I am getting random failures and disconnects.
Is there are way to specify the maximum number of simultaneous tests within this single running job?
I think you have to use a matrix job to trigger the builds of a separate job doing the real build. Then
you can use the Throttle Concurrent Builds Plugin to limit the number of parallel executions of that job you start by the matrix.
For multi project configuration
First you need to create a throttle category. In this case, the name is qa-aut and I limiting the number of execution to 2 for concurrent builds and concurrent builds per node. The node will have 4 executors available.
In your job configuration, make sure you don't run the multi-project sequentially:
Set up throttling builds, selecting "Throttle this project as part of one or more categories", "Multi-Project Throttle Category"(qa-aut) and "Throttle Matrix configuration builds". You can leave in blank the rest of the values
Make sure your node/master has enough executors available. In this case, the master will have available 4 executors
Execute your multi-project job
Instead of using 4 executors (all the availability), you will see it's using only 2 executors (2 threads) as specified in the category.

Randomise slave load on Mesos

trying to solve some problem with Mesos. I have three build servers for Jenkins. Jenkins schedules jobs on them through Mesos.
For now, Mesos loads one agent(slave) as hard as possible, but I want it to spread jobs across all agents..
As I see, it's better to run three jobs on three agents, than on one.
Is it possible to randomise job scheduling?
Or perhaps, I have such scenario. 2 large servers and one mini. I want to schedule Jobs on mini by default, and if it's not enough resources, then proceed to large servers. How can I achieve this goal? Is it possible to set priority for agents(slaves) to specify on which agent I want job to run at first?
The Mesos plugin for Jenkins attempts to build on the most recently built slave (see this method). This means that once it builds on that machine once, as long as that machine still has available spare resources - it'll schedule additional jobs on that machine until it is full. Right now it looks like that isn't optional (I have filed it as a feature request).

Assign "cost" to a Jenkins slave?

I have a Jenkins master setup with several slaves in our primary data center and one slave in our DR/BC (disaster recovery/business continuity) data center.
I would like jobs to run on the DR slave regularly to ensure it stays up to date with the required software and doesn't get stale, but since our DR center is geographically distant from the resources used in the builds & tests (SAN, DB, etc.) jobs take 4x - 10x longer to run. This is fine for a DR scenario, but painful for everyday life.
It appears that Jenkins sorts the slaves alphabetically for selecting which to run a job on, which is unfortunate because our machine naming convention is based on datacenter location, and the DR slave is always picked first.
Is there a way to specify how Jenkins picks a slave? or a way to specify a "cost" (like a routing cost) of a slave, so that it will be picked less often?
The solution I have settled on:
Configure the DR slave Availability as "Take this slave on-line when in demand and off-line when idle"
Create a "BuildAll" job to launch all of the integration builds at the same time.
Schedule BuildAll to run repeatedly at 3am ( 0-10 3 * * * )
This will force the DR slave to come online, and run random jobs several times which should show if that slave has fallen behind in any required software, patches, etc.

Jenkins: group jobs and limit build processors for this group

we are running Jenkins with lots of jobs. At the moment these jobs are kind of grouped by using "master jobs". These do nothing but start all jobs of one group. But, if one of these master jobs runs, it starts around 10 other jobs at one time. Depending on the duration of these jobs and the number of build processores (at the moment 6) Jenkins is blocked for a longer time (up to an hour). The other thing is, that these jobs are not really suitable for such massive parallelization.
To solve this, I'm looking for a way (a plugin), that allows to group some jobs and start them parallel, but limit the build processors used for the jobs of this group to a fixed number (e.g. 2). So it would be possible to run a group of jobs that compile java projects and parallel another group of jobs that installs test databases.
I tried the Build flow plugin, but it's not really the right one: you must separate the jobs manually to the sub-groups that run parallel and if a job in one sub-group failes, the following jobs of this group are not started.
So, maybe someone knows a Jenkins plugin that fits better? Thanks a lot in advance!
Frank
Throttle Concurrent Builds Plugin
Create some category my-group.
Add all the jobs into this group.
Set Maximum Total Concurrent Builds and Maximum Concurrent Builds Per Node.

Resources