Jump to content

How to optimize the system boot time


Guest kempelen
 Share

Recommended Posts

Guest kempelen

What services can I turn off? What other optimalizations can I have to reach faster boot time? Is there a guide for this?

 

(This question may belong to another topic but I could not find a better matching one, sorry.)

 

I already removed rwhod, webmin, cups (hope cupsd running is not necessary for printing to another cups or lpd server), nfsd (was not really running, empty exports, but slows down boottime), lisa (I dont know what exactly this is and why whould I need it), irda (no one installed).

 

Optimizing for boot time and reducing memory usage. Is there any guide directly for Mandrake linux? :-)

 

Thanks,

Ferenc

Link to comment
Share on other sites

I don't know of a HOWTO for that, but I know it has been discussed many times athttp://www.club-nihil.net/mub/index.php, and I know at least once here http://www.mandrakeusers.org/viewtopic.php...=380&highlight=

 

If you are root or have the privleges you can start and stop services.

cups (hope cupsd running is not necessary for printing to another cups or lpd server)
I believe it is, so if you don't want it at start up, when you need it
[root@localhost bvc9]# service cups start

Loopback device ('lo', 127.0.0.1) needed by CUPS, starting it ...

Adding loopback device to routing table ...

Loading parallel port printer kernel modules ...

Starting CUPS printing system:                                  [  OK  ]

[root@localhost bvc9]# service cups stop  

Stopping CUPS printing system:                                  [  OK  ]

[root@localhost bvc9]# service --help

Usage: service -[Rfshv] SERVICE ARGUMENTS

       -f|--full-restart:      Do a fullrestart of the service.

       -R|--full-restart-all:  Do a fullrestart of all services currently running.

       -s|--status-all:        Print a status of all services.

       -d|--debug:             Launch with debug.

       -h|--help:              This help.

       -v|--version:           Print version.

 

version 1.12

[root@localhost bvc9]#

 

Also, to find out what they are, most of them have a man page, so if you want to know what lisa is, type

man lisa

Link to comment
Share on other sites

does it really matter a great deal how fast your boot time is in linux?

once booted linux doesn't need rebooting so boot time becomes irrelevant.

unless you dual boot often of course, if you mean that you want to run with less resources by switching off services you don't need then yes you can get rid of a fair amount of stuff depending on how much functionality you need.

 

You can free up heaps of resources by not running a window manager and Xfree :P

Link to comment
Share on other sites

Let's see:

 

+300W for the PC

+150W for the monitor

+30W for Audio

+10W for all the shit beeing "on" together with the rest

----------------------------------

490W x 24h x 365 d = 4.292,4 kWh

 

4.292,4kWh x 13,20 cent / kWh = 566,60 € !!!!!!!!!!!

 

Look onto your vacuum cleaner, pretty the same :mrgreen:

 

If you take HALF of that, cause your argumenting with powermanagement or no audio at night and so on, although there are 230 € left!!

Link to comment
Share on other sites

I don't know why you'd say that? Why would anyone with a dialup modem, that is not on a network want half the crap ML runs after an install? Who needs harddrake running all the time, much less ever? Fam, xinetd, portmap, and about 3-5 others are completely useless. Fam, xinetd, portmap are only necessary for me if I want to run gnome, NOTilus, and gedit. Not to mention that if you're not on a network , ML is so secure by default you don't "need" a firewall, especially if you're careful about how and when you run servers. Anyway, don't want to debate or anything, it's just how I prefer to run ML.

Link to comment
Share on other sites

I've got a "fast" machine, but i disabled a lot of services just because i AM shutting down the machine, when i am off.

 

So i don't like it to start up so slow, because of an huge overhang of services, although the machine is pretty fast.

 

At least, it's all on you, because most services don't occupy the system noticably and need only some k of memory.

 

Unfortunately there are dependencies between devfshd and xinetd, so try your hardware after disabling some of this "important" services.

 

Interesting is CD and CDR, as USB and FIREWIRE (not sure about that, a friend told me).

Link to comment
Share on other sites

I have no problem with not running harddrake but as Geldroma says, there are those that interact with each other such as devfs and xinetd, and it would seem that more interaction is occuring with each successive release. I picked the number of 64 Mb with a new user in mind who does not want a performance hit and is not yet familiar enough with Mandrake Linux to be shutting things down without some knowledge of the effects. After one has spent some time with the Mandrake manuals on the desktop and the How-To's there as well, then you can take on the issue of tuning your machine for maximum performance.

 

The best solution is to run Gkrellm and watch your CPU performance. I have not disabled as much as I could and my CPU usage is 1-2% of 384 Mb and none of my doubled swap at idle. Running Mozilla now occasionaly hits 20% and and at no time has the swap been used. I'm on dialup with no firewall. OTOH, Lbreakout2 uses all of the memory and some of the swap. So in the final anlysis, what you delete in boot depends on what you are doing with the machine.

 

Counterspy

Link to comment
Share on other sites

Guest kempelen

Hi!

 

Yep, thanks for the ideas guys. Yep, I need this to save some memory, not exactly boot time. I have 128MB in IBM Thinkpad (600X), running XFce3.2 as window manager (to save ram) and I wanted to save some more RAM for Mozilla and OOo. I think I will also move MySQL and Apache to Xinetd, coz I need them only when I am travelling or I am at home (at the office we have dev server)

 

There are just some general points on the referenced link, so I will keep on trying. That thread also speaks about the too much cron jobs: yep, I do not much like that the computer runs a lot of awk and such things just after startup. Its ok for server running at night (cron.daily) but for workstation it makes impossible to play Armagetron just after the launch!

 

I removed "makewhatis" :-) Thats all I could do with this. I use this command very seldom. Maybe I will move it to cron.weekly.

 

Ferenc

Link to comment
Share on other sites

Something I wrote on the club-nihil MUB:

I want to get Linux to boot REALLY fast.
I do, too ;-) 8) :lol:

 

I don't know much of it, but here is a "trick" I use at home. I:

- want the computer to boot fast

- want to run apache, slapd, popd, imapd, xteld...

It sounds like a contradiction, doesn't it?

 

My solution is to make two lists of boot services (daemons):

-1- the services that are needed to start, up to the login screen (system-related),

-2- the services that are not needed to login (application-related).

 

In -1-, I have xfs and numlock.

In -2-, I have apache, xinetd, slapd, network, and cups.

 

The services from group -1-, I let start the usual way

The services from group -2-, I disable them all, and then I create a new service of my own in this file: /etc/rc.d/init.d/myservices

#!/bin/bash

case $1 in

start)

( sleep 1m; bash >/dev/null 2>&1 <<-FIN

       /etc/rc.d/init.d/xinetd start

       /etc/rc.d/init.d/slapd start

       /etc/rc.d/init.d/httpd start

       /etc/rc.d/init.d/network start

       /etc/rc.d/init.d/cups start

FIN

) &
;;

stop)

       /etc/rc.d/init.d/xinetd stop

       /etc/rc.d/init.d/slapd stop

       /etc/rc.d/init.d/httpd stop

       /etc/rc.d/init.d/network stop

       /etc/rc.d/init.d/cups stop
;;

restart)

       /etc/rc.d/init.d/xinetd restart

       /etc/rc.d/init.d/slapd restart

       /etc/rc.d/init.d/httpd restart

       /etc/rc.d/init.d/network restart

       /etc/rc.d/init.d/cups restart
;;

esac

And I enable myservices at boot in runlevel 3 and 5.

The result is that myservices is just skipped at boot (start is done in background and begins with a sleep command). But one minute (1m) after it is called, myservices begins working. In this minute I have the time to log in and open whatever applications I want.

 

The 1m parameter is the thing you have to tune to your machine. if your "stripped" machine boots in 15seconds, and you give yourself 15seconds to log in, then you'll replace 1m with 30s.

 

Yves.

Link to comment
Share on other sites

  • 5 months later...

The topic http://www.mandrakeusers.org/viewtopic.php?t=4563 has reminded me that some time ago I wrote my own "myservices" based on yours; Just for curiosity here it is:

 

DELAY="1m"

SERVICES="httpd mysql postfix cups"



case $1 in

     start) (sleep ${DELAY} && sh &> /dev/null <<- EOF

           eval $(egrep "^SERVICES"  /etc/rc.d/init.d/myservices)

           for service in $SERVICES; do

                 /etc/rc.d/init.d/${service} start

           done

           EOF

           ) &;;

     

     stop) for service in $SERVICES; do

           /etc/rc.d/init.d/$service stop

           done;;



     restart) for service in $SERVICES; do

           /etc/rc.d/init.d/$service restart

           done;;



     *) echo "Uso: ${0##*/} [start|stop|restart]";;

esac

 

Add the name of each service you want to start delayed to the variable SERVICES.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...