HOWTO: Speeding up Debian

Share your own howto's etc. Not for support questions!

Postby chrismortimore » 2007-05-29 07:57

jombeewoof wrote:inetd is basically a superserver. some net services(read ftp, ssh, et al) can be set to rely on this to run. not necessarily necessary on any system.
inetd is hardly used these days, as most of these services are now started by their own init.d scripts anyway (because you get greater control over them when you don't use inetd). The only thing I have that uses inetd is vmware.
Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 5x320GB WD 7200rpm Caviar RE2 (RAID5), Nvidia 6600GT 256MB
Laptop: Intel Pentium M 1.5GHz, 512MB PC2700, 60GB 5400rpm IBM TravelStar, Nvidia 5200Go 64MB
User avatar
chrismortimore
 
Posts: 862
Joined: 2007-04-24 06:34
Location: Edinburgh, UK

Postby Bulkley » 2007-05-29 19:49

chrismortimore wrote:inetd is hardly used these days, as most of these services are now started by their own init.d scripts anyway . . .


Good info. I disabled the one line left in inetd.conf (netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd) and everything still runs. Can I safely remove inetd?
Bulkley
 
Posts: 5884
Joined: 2006-02-11 18:35

Postby chrismortimore » 2007-05-29 21:44

Bulkley wrote:Can I safely remove inetd?
I think some things require it to be installed. But you don't have to run it. The only package I have installed that needs it is "netbase" though.
Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 5x320GB WD 7200rpm Caviar RE2 (RAID5), Nvidia 6600GT 256MB
Laptop: Intel Pentium M 1.5GHz, 512MB PC2700, 60GB 5400rpm IBM TravelStar, Nvidia 5200Go 64MB
User avatar
chrismortimore
 
Posts: 862
Joined: 2007-04-24 06:34
Location: Edinburgh, UK

Postby Bulkley » 2007-05-31 14:56

I discovered that inetd has been replaced by xinetd.

Swappiness is a new term for me. It refers to the choice the computer makes between using memory or harddrive swap partition. The swappiness is usually set to 60, but we can change it. Some experts set it to 100; others to 0. If you have a lot of memory, you can speed your machine behavior by lowering its swappiness. I set mine to 10 but everyone has to make his own decission on this. Check this article http://www.linuxjournal.com/article/8308 for instructions.

Swappiness is one of those issues that needs some benchmarking tools. Any suggestions?
Bulkley
 
Posts: 5884
Joined: 2006-02-11 18:35

omitted stuff

Postby madsurgeon » 2007-06-03 23:29

Hi all

I've found this thread by chance when searching for the relevant info. It was a good read. Many tips have been discussed. Yet a few have been forgotten. Therefore I have registered myself and here are some more:

- first of all, before messing around in your system, make some investigations what really eats up processor cycles and/or memory. Useful candidates are top, xrestop, dpigs and du -S.

- concerning the discussion about display managers:
I agree that wdm is the best one on small systems, but why use a dm at all? If you don't like logging in on a text console, try Qingy. I love it.

- nobody mentioned hdparm. When it comes to speeding up disk access there's no way around hdparm.

- if you're on a particularly small system (like me on my old laptop with a 300MHz processor and 32MBy of RAM), you might get even a shorter bootup when changing getty for fgetty, a very small and fast getty clone.

- in terms of window managers, my personal favorite on small systems is evilwm. It's very lightweight and fast. No bells and whistles, but a set of very good keyboard shortcuts. And it's easily customizable.

- network speed: you might get some speed improvement by issuing
# echo "0" > /proc/sys/net/ipv4/tcp_sack
# echo "0" > /proc/sys/net/ipv4/tcp_timestamps

- it happens that you are connected to a router which does not understand ipv6. You can see that if your browser always waits before transmitting data. In that case disable ipv6 entirely.

- have a look at the powertweak package

- concerning the bootup process there are interesting reads here and here.

- if you're looking for speeding up iceweasel (former firefox) you might be interested in this.

- for speeding up the desktop experience there were two articles in Linux Journal two years ago. Some stuff is certainly still useful.

And then we could join forces and update the wiki article to the same topic at http://wiki.debian.org/?LinuxSpeedup .

Cheers
madsurgeon
 
Posts: 1
Joined: 2007-06-03 21:25
Location: Zurich, Switzerland

Postby Lou » 2007-06-04 11:39

Thx for the articles, madsurgeon, it sure is interesting!
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Postby Lou » 2007-06-05 14:34

I launched sysvconfig and disabled:

atd
cron

I did this 2 weeks ago, and so far it hasn't changed anything on my system.
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Postby Bulkley » 2007-06-08 15:05

Lou, you don't need cron?
Bulkley
 
Posts: 5884
Joined: 2006-02-11 18:35

Postby Lou » 2007-06-08 16:38

I don't think so, what for? Maybe i do...and don't know it?
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Postby AgenT » 2007-06-08 19:25

Just off the top of my head, you need cron to:
- rotate logs
- update the find database
- update man database
- take care of lost+found
- take care of exim (default MTA - required for error messages, etc.)

I am sure there are plenty of others. Disabling cron is just asking for trouble in the long run. Cron jobs are an essential part of Linux systems. Essential programs assume that it is up and running. Do NOT turn crond off.
User avatar
AgenT
 
Posts: 500
Joined: 2007-01-21 01:25

Postby Lou » 2007-06-08 20:56

I never knew that, thx!
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

Postby diego1116 » 2007-06-11 23:34

If you don't want "cron" running all the time, I think you can switch to "anacron" (I never tried it though):

http://packages.debian.org/stable/admin/anacron
Package: anacron (2.3-13)
cron-like program that doesn't go by time

Anacron (like `anac(h)ronistic') is a periodic command scheduler. It executes commands at intervals specified in days. Unlike cron, it does not assume that the system is running continuously. It can therefore be used to control the execution of daily, weekly and monthly jobs (or anything with a period of n days), on systems that don't run 24 hours a day. When installed and configured properly, Anacron will make sure that the commands are run at the specified intervals as closely as machine-uptime permits.

This package is pre-configured to execute the daily jobs of the Debian system. You should install this program if your system isn't powered on 24 hours a day to make sure the maintenance jobs of other Debian packages are executed each day.

http://anacron.sourceforge.net/
What is Anacron not?

Anacron is not an attempt to make cron redundant. It cannot be used to schedule commands at intervals smaller than days. It also does not guarantee that the commands will be executed at any specific day or hour.

It isn't a full-time daemon. It has to be executed from boot scripts, from cron-jobs, or explicitly.
User avatar
diego1116
 
Posts: 361
Joined: 2007-03-28 17:49
Location: Santa Maria, RS, Brazil

Postby synss » 2007-06-22 16:07

Hello all, I think these were not mentioned here (but sure were at other places):

link /bin/sh to /bin/dash

dash is a lightweight POSIX shell, /bin/sh is called via the shebang (#!/bin/sh) by most shell scripts, calling a lighter shell will make it start faster, makes a difference on boot up. Ubuntu has that by default.

I like putting /tmp and /var/run on tmpfs, tmpfs is like using part of your ram as a file system

Code: Select all
/etc/fstab
...
tmpfs   /tmp   tmpfs   defaults 0 0
tmpfs   /var/run   tmpfs   defaults 0 0

you can achieve the same with mount --bind to /dev/shm and it is actually very nice to have a rc script to mount tmpfs on /dev/shm as should be, create directories in it and mount bind /tmp and /var/run (and $HOME/my-tmp) in there.

EDIT: note that I also have /var/lock and /var/log on there, /var/log is not recommended, because the logs will be lost if something goes wrong and the computer shuts down. But I am using a laptop, so I do not care much about the logs anyway.

Also, putting all that on tmpfs requires a bit of tweaking in the init.d stuff or /etc/syslog.conf to get rid of error messages, things like
[ ! -d /var/run/screen ] && exit 0
and the like.
END OF EDIT


now about cron anacron and atd

Another thing is cron, anacron and atd are NOT the same thing!
1. you want cron, period
2. anacron is not a daemon, and removing it is not a good idea: either your system is always up, in which case it is never executed (so nothing changes whether it is there or not) or you shutdown your laptop/workstation, in which case, cron will fail to, say, update you man page index or locate at 3am and you need anacron to do it
3. at it extremely useful on shared workstation, I mean, computers you send jobs to for number crunching, it is not useful for any other case, AFAIK. at is such that it executes a job you have sent it when it can, meaning, when some other job has finished executing and frees enough CPUs for the next job.
=> It is awesome when you need it, if you do not know what it is you do not need it.
Last edited by synss on 2007-06-25 09:31, edited 1 time in total.
synss
 
Posts: 28
Joined: 2007-06-22 15:35
Location: Japan

Postby chrismortimore » 2007-06-22 17:00

synss wrote:now about cron anacron and atd

Another thing is cron, anacron and atd are NOT the same thing!
Skip back to page 4, it's been said already: viewtopic.php?p=69922#69922
Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 5x320GB WD 7200rpm Caviar RE2 (RAID5), Nvidia 6600GT 256MB
Laptop: Intel Pentium M 1.5GHz, 512MB PC2700, 60GB 5400rpm IBM TravelStar, Nvidia 5200Go 64MB
User avatar
chrismortimore
 
Posts: 862
Joined: 2007-04-24 06:34
Location: Edinburgh, UK

Postby Lou » 2007-06-23 18:21

While googling for something else i ran into this. Some tips are in this thread, some are not, good read anyhow.

Optimizing Desktop Performance Part 1
http://www.linuxjournal.com/article/8308

Part 2
http://www.linuxjournal.com/article/8317

Part 3
http://www.unix-tutorials.com/go.php?id=331
Devuan Jessie - IceWM - vimperator - no DM
KISS - Keep It Simple, Stupid
Lou
 
Posts: 1775
Joined: 2006-05-08 02:15

PreviousNext

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable