Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
cat /proc/slabinfo should give you some idea of the caches being used by some areas of the kernel and /proc/meminfo will give you some more in depth stats on system memory usage. You could also sum the memory usage of all the processes reported by ps and subtract it from the total amount of memory as reported by top.
just so you know kernel is using barely any memory as compared to the overall system. For example, when my system boots and after ALL the startup processes are loaded the overall memory usage is just about 100 MB, and that's with apache, mysql, etc running. (its a server so no X). What kills the performance is the amount of stuff compiled into it. Think of the kernel as a complex filter. if you have 10 layers (small kernel) anything that is sent to the kernel will have to pass through average of 5 layers to get to where its going, if you have 100 layers (large kernel) the average will be 50 layers, and that's where performance drop occurs and not in the amount of memory used, which is negligible in either case. That is why the smaller the kernel, the better performance is. Turn off anything you won't ever need and modularize as much as you can.
Hope this helps.
Small note: A large kernel is about 10 MB in size. My smallest one was/is about 850 KB (with everything working perfectly; that's 2.4.26). My average now is about 1.2 MB with LVS, routing and IPtables (on 2.6.8), plus i compile few things in that can be inserted as modules (i'm lazy ) so that bumps the size a bit.
Last edited by Mikhail_16; 08-20-2004 at 12:57 AM.
So then by your logic, the less modules and drivers/items which are compiled into my kernel the "Faster" my system will run????
Even if some options are added as modules does this make an effect on the "speed" of the kernel?
Say for example 10 different network card modules are setup in the kernel and i'm only use one of these.
The other 9 should be removed because it will increase the "Speed" of which my system is able to process requests which are put to the kernel as i understand it everything goes though the kernel similar to Windows NT etc?
you modularize, so that you can load and unload the modules when and if needed.
modules are not actually compiled into the kernel, but need to be actually loaded (inserted) to be of any effect. that's why you can have as many modules as you want with absolutely no loss of performance as long as they are not loaded into the kernel. and that is why its better to compile things as modules rather then 'build them in'. see the logic?
Plus there are quite a few things that cannot be modularized and are also not needed. for example you don't need to compile anything that relates to scsi if you don't have a scsi card in your box, or there is no need for reiserfs support if you are not going with that filesystem; the list goes on.
Last edited by Mikhail_16; 08-20-2004 at 02:07 AM.
Small addendum: just so you know, there are things that can be modularized, but should not be, like filesystem support. Also always read help on anything that has it in the kernel. Also check that you include nessessary modules to be loaded on boot, you'll need things like sound, network card(s), usb support, etc. I believe kudzu for redhat/fedora and hotplug for gentoo do that automatically, but i'm not sure about the rest.
Last edited by Mikhail_16; 08-20-2004 at 02:13 AM.
cool. I'm using 188.8.131.52 and had it trimmed down, but then couldn't get the dvd/cd burner to work, so redid the config several time before I found out it was a kernel 'feature'. So i have a partially trimmed kernel, but it's still 5 meg. Not sure how much smaller I can get it on this box as it already just seems to have the stuff I need, except for a couple of chipset drivers I forgot to remove from the default this time.
oberon ~ # ls -l /boot/
-rw-r--r-- 1 root root 784055 Aug 18 12:00 System.map
-rw-r--r-- 1 root root 802555 Aug 18 08:53 System.old
lrwxrwxrwx 1 root root 1 Aug 18 09:55 boot -> .
-rw-r--r-- 1 root root 512 Aug 18 08:08 boot.0300
drwx------ 2 root root 12288 Aug 18 08:56 lost+found
-rw-r--r-- 1 root root 1170319 Aug 18 08:07 stable
-rw-r--r-- 1 root root 1091429 Aug 18 12:00 vmlinuz
-rw-r--r-- 1 root root 1170326 Aug 18 08:53 vmlinuz.old
oberon ~ # lsmod
Module Size Used by
e1000 81668 0
3c59x 37160 0
intel_agp 22048 1
agpgart 33320 1 intel_agp
evdev 9728 0
rtc 12600 0
tun 9216 0
bridge 48408 0
This is a box that will serve as a router/openvpn gateway/firewall for a network. so you still have aways to go with your kernel configuration. Plus lsmod withough iptables running (just to show the modules loaded).
Yeah, hold on I'm all confused as usual and comparing vmlinux to vmlinuz to bzImage and all the rest... IF I make bzImage I get a 1.6 meg kernel and that as small as it gets for me. Just went through and pulled out the couple of bits I didn't need.