Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to run RPM Installation in parallel?

Tags:

deployment

rpm

I am working on a performance improvement task in deployment process. While going through the process, I see that the rpm installation is happening sequentially and dependent package installation takes more time. I am a newbie to RPM and searching for a way to run these installation in parallel to reduce the deployment time.

It will be great if you could provide me a suggestion/solution to run these rpms in parallel!

like image 237
Jay Avatar asked Mar 29 '13 06:03

Jay


1 Answers

So when you install an RPM it creates what is called a rpm database lock, and this lock file keeps you from running another instance of rpm (and by association yum). I imagine this was put in place to ensure the transaction doesn't get screwed up when multiple packages are trying to install. Imagine having a package that requires an updated version of a lib you're already installing, how would that conflict if two processes were trying to modify those files one after another, how would the library linking work, what sort of reference issues might there be, etc.?

This means that even if you tried to install two RPMs from two different terminals, the second attempt would fail, because that first process already has the rpm database lock, and you have to wait till that lock is released before you can install from another terminal, or basically another process.

So this leads us to another question, if we have to install the packages in sequence, how can we increase the speed at which the RPMs install? I'd suggest reviewing the following options:

Review WHERE the RPMs are getting pulled down from, if it's from some outside EPEL machine, or another server outside your network, consider setting up a local mirror, this would allow packages to be updated on your mirror, and then when you perform your deployment you're pulling from a local location where you have much more bandwidth to ensure it's getting to the machine as quickly as possible.

Consider reviewing RAM utilization during your deployment, if the box is getting hammered, the yum install is going to be much slower. It might be worth stopping certain services during the deployment to increase the installation if that is possible.

Confirm you NEED everything that is being installed. Is it possible some of these packages could get rolled into the initial server build via a kickstart or configuration management tool? Could the RPMs we're installing (if custom) have dependencies that are a default in your organization, and aren't really needed (sometimes people just have a default spec everything is built off)?

These are all the suggestions I can think of right now, hopefully that helps you get started.

like image 166
Forrest Avatar answered Sep 22 '22 18:09

Forrest