PDA

View Full Version : Can we speed up Network Manager?



utu
02-28-2011, 07:53 PM
My Windows 7 boots to wi-fi on-line in ~60 seconds.
My Knoppix 6.4.4 LiveUSB does so in 1m46s.
Looking at syslog, it appears that the last 48 seconds
of any boot-up are spent doing Network Manager negotiations.

NM is doing its job here, but doesn't seem as clever as
Win7 in getting its job done; certainly not as fast.
In my case, wi-fi means a Dell internal Broadcom wireless
with a (non-free) wl driver, a DHCP router connected
to the internet via Verizon FiOS at 15 Mb/s. Simple
WEP security. Applet says NM is version 0.8.1.

I have an external wireless adapter that doesn't use a
non-free driver, and get the same results.

Are there some tweaks that would speed up NM?

utu
03-04-2011, 06:46 PM
Well, thank you all for your suggestions.
Here's how far I've got, and I'm open for further enhancements.

1...I found this nice Ubuntu How-To which helps a lot:
http://ubuntuforums.org/showthread.php?t=684495

2...I did what it says, and put, as root, this in my /etc/rc.local:
sudo dhclient -r eth1
sudo ifconfig eth1 up
sudo iwconfig eth1 essid "alpha=num essid"
sudo iwconfig eth1 key "10 char hex key"
#sudo iwconfig eth1 key open # didn't need this apparently
sudo iwconfig eth1 mode Managed
sudo dhclient eth1

3...I revised my LiveUSB DEFAULT, as root, to read:
DEFAULT knoppix nonetworkmanager edd=off fromhd=/dev/sdb1
That's the 1st line in /Desktop/KNOPPIX/boot/syslinux/syslinux.cfg

4...Rebooted.‎

5...Did less /var/log/syslog.
Found that start-of-boot to wi-fi on-line now takes 58 seconds.

Beat that.

Forester
03-05-2011, 01:42 PM
Well, thank you all for your suggestions.

What ? Deprive you of your learning opportunity ? In my book that's a cardinal sin.

Besides, if I suggested that the best way of speeding up the Network Manager was to not run the Network Manager I'd have had klaus2008 down on my tail (http://www.knoppix.net/forum/threads/29059-wireless-connects-in-graphical-mode-but-not-in-Adrianne).



I found this nice Ubuntu How-To which helps a lot:
http://ubuntuforums.org/showthread.php?t=684495
Beat that.

http://wiki.debian.org/WiFi
http://wiki.debian.org/WiFi/HowToUse

You managed to find a real hacker's hacker - he didn't mention /etc/networks/interfaces once ! You then come up with a solution that names your wireless interface eth1 instead of the usual wlan0. Extra marks. :smile:

Here's what the Debian installer put in my /etc/networks/interfaces to bring up my wifi with WEP:


# The primary network interface
allow-hotplug wlan0
iface wlan0 inet dhcp
# wireless-* options are implemented by the wireless-tools package
wireless-mode managed
wireless-essid MyEssid
wireless-key1 **********
It is my understanding that with this the most you would need in /etc/rc.local is:


ifup wlan0and you might not even need that.

Ever since I first met the wonderful Network Manager, I've had a manual way of getting my wireless going just in case. I normally use WPA PSK2. If my WPA PSK2 configuration is hidden away in:


/etc/wpa_supplicant.confThen I can start my wireless by hand with:


sudo wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
sudo dhclientHow many sudos did you use ? BTW I don't think you need sudo in /etc/.rc.local.

I found recently that I can combine the two approaches with:


# The primary network interface
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf
The problem with the Network Manager is not just that it is started when your PC / LT is busy starting everything else, it's not just that the Network Manager is a big desktop app, it's not just that the LXNetMan is still 'in development'. It's that the Network Manager does not try to connect until you login in. This is not obvious with Knoppix but if you try it on a real desktop installation you'll see what I mean. Thus the Network Manager starts connecting very late in the startup sequence so it appears slower that Windoze.

By connecting without the Network Manager, you starting connecting much earlier in the startup sequence. The cost is that you must already know which network you want to connect to. This may not be a concern to you but for those that carry their laptop round like security blankets and use them everywhere like they were mobiles (or handys or cells), this could be a real drawback.

Enter wicd. This is a new, ligthweight, alternative to the Network Manager. It is not as flash as the Network Manager but I understand it will connect in both GUI and console modes. This leads me to believe it must be possible to start it much earlier in the start up sequence.

I have it running on one Debian laptop but I don't have the time to experiment with it any further. You might like to. If your name is dinoesep, back up your knoppix-data.img first 'cos I think you'll need to uninstall Network Manager in order to install wicd. Obviously, start your network first !

Cheers

utu
03-05-2011, 06:03 PM
Faint praise accepted.
I never uninstalled NM, just added nonetworkmanager cheatcode to my DEFAULT;
see step 3.
Also, my /etc/rc.local belongs to root.

utu
06-13-2011, 12:13 AM
Heres' my latest. On-line now in 50 seconds.

#!/bin/bash

# /etc/rc.local (mine is root:root and executable)

# other stuff(1)

setwifi () { # see http://ubuntuforums.org/showthread.php?t=684495
WIFI="eth1"; dhclient -r $WIFI; ifconfig $WIFI up
iwconfig $WIFI essid "(alphanumeric ssid)" key "(hexadecimal wep)" mode "Managed"
nohup dhclient $WIFI; wait >/dev/null 2>&1
aplay -vv /usr/lib/libreoffice/basis3.3/share/gallery/sounds/ok.wav
}

# other stuff

setwifi(2)

# other stuff(2)

exit 0

utu
06-13-2011, 12:25 AM
FYI, Here's how I've been timing these results.

I've added these to my .bashrc:

alias wl.go='less /var/log/syslog|grep restart|cut -c11-16'
alias wl.up='less /var/log/syslog|grep renewal|cut -c11-16'

So right after booting up, I can time the event this way:

knoppix@Microknoppix:~$ wl.up; wl.go
57:17
56:27

I do the subtraction myself, of course.
Glad to have an expert show me how to program that detail

utu
06-13-2011, 12:36 AM
Heres' my latest. On-line now in 50 seconds.

#!/bin/bash

# /etc/rc.local (mine is root:root and executable)

# other stuff(1)

setwifi () { # see http://ubuntuforums.org/showthread.php?t=684495
WIFI="eth1"; dhclient -r $WIFI; ifconfig $WIFI up
iwconfig $WIFI essid "(alphanumeric ssid)" key "(hexadecimal wep)" mode "Managed"
nohup dhclient $WIFI; wait >/dev/null 2>&1
aplay -vv /usr/lib/libreoffice/basis3.3/share/gallery/sounds/ok.wav
}

# other stuff(2)

setwifi

# other stuff(3)

exit 0

kl522
06-14-2011, 12:11 AM
If you are concerned about security, NEVER NEVER NEVER used wep.
WEP can be cracked in about 5-30 minutes, does not matter how long your password/passhrase.

dinosoep
06-14-2011, 01:53 PM
You should fiddle around in knoppix-autoconfigure to replace the original network manager with wicd like I did, it's described somewhere in a post.
I have the feeling its under 60 seconds but maybe thats just me.

luther
01-29-2014, 06:29 PM
Heres' my latest. On-line now in 50 seconds.

#!/bin/bash

# /etc/rc.local (mine is root:root and executable)

# other stuff(1)

setwifi () { # see http://ubuntuforums.org/showthread.php?t=684495
WIFI="eth1"; dhclient -r $WIFI; ifconfig $WIFI up
iwconfig $WIFI essid "(alphanumeric ssid)" key "(hexadecimal wep)" mode "Managed"
nohup dhclient $WIFI; wait >/dev/null 2>&1
aplay -vv /usr/lib/libreoffice/basis3.3/share/gallery/sounds/ok.wav
}

# other stuff(2)

setwifi

# other stuff(3)

exit 0

Dear utu:

Q: Which version's of knoppix is this script compatible?

I'm interested using WLAN CLI alternatives to the bloated network-manager GUI w/7.0.3!

Regards,
luther

luther
01-29-2014, 06:50 PM
Heres' my latest. On-line now in 50 seconds.

#!/bin/bash

# /etc/rc.local (mine is root:root and executable)

# other stuff(1)

setwifi () { # see http://ubuntuforums.org/showthread.php?t=684495
WIFI="eth1"; dhclient -r $WIFI; ifconfig $WIFI up
iwconfig $WIFI essid "(alphanumeric ssid)" key "(hexadecimal wep)" mode "Managed"
nohup dhclient $WIFI; wait >/dev/null 2>&1
aplay -vv /usr/lib/libreoffice/basis3.3/share/gallery/sounds/ok.wav
}

# other stuff(2)

setwifi

# other stuff(3)

exit 0

ATT: knoppix team
Q: How would this script be ammended to my existing 'rc.local' and made 'root:root' & 'executable'?



#!/bin/bash
#
# rc.local
#
# Start local services after hardware detection

SERVICES="cups"

for i in $SERVICES; do
[ -x /etc/init.d/"$i" ] && /etc/init.d/"$i" start >/dev/null 2>&1
done

exit 0



THX!
luther

utu
01-29-2014, 07:17 PM
Greetings, luther.

I'm using Knoppix 7.2 and just the following in rc.local now:
sudo iwconfig wlan0 txpower 5mW rate 54M key (key code) essid "(essid name)"
Time to browser on-line is 50 seconds, same as when using Win7 on this laptop.

FWIW.
1. sudo is not really necessary as Forester has pointed out.
2. Klaus K has changed the 7.2 boot up process somewhat to improve boot time,
but I'm not aware just where and how.
3. The reduced transmit power was a suggestion of Klaus K's to counter-act
local wifi interference. I don't know if this helps on time to connect
but it seems to improve the frequent disconnect situation here.
4. It's quite likely Network Manager has improved as well since this thread
was initiated.

In answer to you question, I suggest the following:

As root call up leafpad and edit /etc/rc.local
by adding the following line just before the "exit 0" line:

iwconfig (wifi's device name) rate 54M key (router key code) essid "(router essid name)"

If that doesn't improve things, then this might be one more reason
to benefit from upgrading to 7.2.

luther
01-29-2014, 10:01 PM
In answer to you question, I suggest the following:

As root call up leafpad and edit /etc/rc.local
by adding the following line just before the "exit 0" line:

iwconfig (wifi's device name) rate 54M key (router key code) essid "(router essid name)"

If that doesn't improve things, then this might be one more reason
to benefit from upgrading to 7.2.

utu,

The line needed to be rooted for the LED to fire, but wasn't able to connect. Therefore, resorted to 'udhcpc' that was installed from synaptic:







knoppix@Microknoppix:~$ sudo iwconfig wlan0 essid mynetwork
knoppix@Microknoppix:~$ sudo iwconfig wlan0 key 6789abcdef
knoppix@Microknoppix:~$ sudo udhcpc -b -i wlan0 -x hostname:Microknoppix -p /var/run/udhcpc.wlan0.pid
udhcpc (v1.20.1) started
Sending discover...
Sending discover...
Sending select for 192.168.0.14...
Lease of 192.168.0.14 obtained, lease time 86400
/etc/udhcpc/default.script: Resetting default routes
SIOCDELRT: No such process
/etc/udhcpc/default.script: Adding DNS 8.8.4.4
/etc/udhcpc/default.script: Adding DNS 8.8.8.8
knoppix@Microknoppix:~$



'udhcpc' freezes knoppix 7.0.3 on my older hardware, giving credence to this post to your 'old' thread.
'udhcpc' has a '-syslog' switch, but is useless when it causes knoppix to freeze!
luther

PS. 7.0.3 has been an excellent PC repair tool and hate to part w/it!
* posted w/udhcpc & w/nonetworkmanager cheatcode

utu
01-29-2014, 10:30 PM
The line needed to be rooted for the LED to fire, but wasn't able to connect. Therefore, resorted to 'udhcpc' that was installed from synaptic:


I didn't make it clear that in Knoppix 7.2, I've gone back to using Network Manager.
I now use only the line I quoted earlier to boot my system.
You are quite right that the line itself must be issued by root.
This is, or may be, done by /etc/rc.local which has root:root ownership.

The programs you like in 7.03 may be available in 7.2 as well.
I'll take a look at my Synaptic to see if that's so, if you'll name it (or them).

luther
01-30-2014, 02:42 AM
The programs you like in 7.03 may be available in 7.2 as well.
I'll take a look at my Synaptic to see if that's so, if you'll name it (or them).

utu,

Give this synaptic front end app a try and see if 7.2 is compatible with ALL its features:




Software-Center
.

7.03 had a few problems with it.
e.g., 4gig persistance.

luther

utu
01-30-2014, 05:49 AM
I note that my version of Synaptic, without being
itself upgraded from the initial 7.2 values,
indicates software-center 5.1.2debian3.1 Utility
is available for download.

I have no experience with using software-center
and no current motivation to use it. Perhaps you
can tell me what it's good-for.

I use reiserfs persistence, but have no current need
for 4 G's of it.

luther
01-31-2014, 05:30 AM
I have no experience with using software-center
and no current motivation to use it. Perhaps you
can tell me what it's good-for.


software-center is where Update Manager resides. It's a memory hog and if it's not wise to update knoppix iso's, shouldn't it be blacklisted?

utu
01-31-2014, 04:20 PM
software-center is where Update Manager resides. It's a memory hog and if it's not wise to update knoppix iso's, shouldn't it be blacklisted?
Greetings again, luther.

You've obviously got the right idea about (not) trying to upgrade Knoppix this way.
Blacklisting software-center might be in order on this principle, but
perhaps a little heavy-handed for some of the more experienced Knoppixers,
who know how to handle the 'dependencey hell' aspect which may arise.