October 6, 2007

linux udpates

Category: Linux — Josh @ 8:46 am

I updated the networking options in the /etc/sysctl.conf file to optimize network communications on my linux server.

I added the following options. A reboot was necessary for them to take effect

net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 3

net.core.rmem_default = 65535
net.core.rmem_max = 8388608
net.ipv4.tcp_rmem = 4096 87380 8388608
net.core.wmem_default = 65535
net.core.wmem_max = 8388608
net.ipv4.tcp_wmem = 4096 65535 8388608
net.ipv4.tcp_mem = 8388608 8388608 8388608
net.core.optmem_max = 40960

September 11, 2007

Server tweaking

Category: Linux — Josh @ 6:14 am

I have made several changes to my jinzora server to make it faster when I am browsing and re-tagging mp3’s over samba.

First I added a mount options to tell linux not to track when a file was last accessed. This speeds up jinzora when re-indexing mp3’s and samba when re-tagging tracks with ID3-Tag-IT . The notail option disables the packing of small files into the file system tree. File system performance is reported to be faster with this option disabled, but increases disk usage by 5%.

/dev/md1 / reiserfs noatime,notail,nodiratime,data=writeback,defaults 0 0
/dev/md0 /boot reiserfs noatime,notail,nodiratime,data=writeback,defaults 0 0

Next I made the following changes to samba which increased the speeds of file writes and reads by over 1Mbyte/sec.

log level = 1
read raw = yes
write raw = yes
oplocks = yes
max xmit = 65535
dead time = 15
getwd cache = yes
lpq cache = 30
interfaces =
bind interfaces only = Yes
restrict anonymous = no
domain master = yes
preferred master = yes
local master = yes
os level = 65
max protocol = NT
ldap ssl = No
server signing = Auto

Next I recompiled the kernel with 2.6.22 source. I took the time time to only enable the options that I actually use, and compiled them into the kernel. I was then able to disable loadable module support.

Lastly, I tweaked the bios settings to enable faster communication on the PCI bus, and teaked the memory settings to allow for faster ram communications. I had neglected doing this because I had no need to bother with it in the past.

I attempted to compile mysql and the kernel with gcc CFLAGS to optimize them for the processor, but was unable to because the CFLAGS were getting reset by the options that were chosen by the Debian package maintainer. I found where I could manually tweak the package files before I compile, but I felt that this would make things too messy and difficult to support when performing upgrades in the future. I may decide to install Slackware or Gentoo in the future, just so I can see what kind of difference I would see from it.

August 21, 2007

More tweaking

Category: Linux — Josh @ 10:10 pm

I did a lot with the server over the weekend. I cleaned up a lot of old rc scripts from debian 3 and 3.1 which made bootup a cleaner (less useless crap scrolling on the screen). The main thing that was bugging me was seeing messages during boot from modprobe not being able to read modules.dep. I got hunted down any scripts that use it and commeneted it out (If I don’t need it, Why have it). The main thing that bugged me is that I kept seeing messages stating (multiple times) Module already loaded.

I setup fetchmail / courier-imap / squirrel mail to read my e-mail through a web browser. I also uninstalled and reinstalled apache several times, thinking that I had broken something in jinzora. After an hour, I discovered that I just needed to clear by browser cache.

I changed the priority of the swap files when they get mounted at boot, I think this is what was causing the server to hang when I was importing media into jinzora. I also added mount options to the root and boot partitions to help speed them up.

/dev/md1 / reiserfs noatime,nodiratime,notail,data=writeback,defaults 0 0
/dev/md0 /boot reiserfs noatime,nodiratime,notail,data=writeback,defaults 0 0
/dev/hde3 none swap pri=1,sw 0 0
/dev/hdg3 none swap pri=1,sw 0 0

I updated a few things on the router. Mainly setting static ip addresses for all the machines on the network in the dhcp, and creating an entry in the hosts file for the internal interface on the router. The dhcp entries in the leases file and the hosts file get used by dnsmasq (running on the router) to resolve ip’s on the local network.

August 15, 2007

2.6.23-rc3 kernel

Category: Linux — Josh @ 8:37 pm

In my quest for faster jinzora performance, I udpated to the 2.6 kernel with the last debian 4.0 release a few months ago, but I was slightly peeved because the stock 2.6.8 kernel in etch seemed a little pokey. I updated to 2.6.18 last week (along with system and filesystem tweaks), but I was left with still wanting a bit more performance.

Today, I downloaded the 2.6.22 kernel and the 2.6.23-rc3 prepatch for the stable tree and compiled my kernel from source. I was a little overwhelmed at the config options in the 2.6.x kernel versus the 2.4 kernel that I had become so familiar with over the last few years. Previously with 2.4 I had figured out all the options that I really needed and had a .config file that I really did not pay attention to besides making sure the options that I wanted were selected.

It took me a couple of hours to go through the help text to check each kernel option in the 2.6 config, but I am happy with what I ended up with. I compiled a kernel with everything I use statically linked in and was able to disable loadable module support. I am a purist at heart, and I do not compile anything unless I will use it. If I evern need usb suport I can easily compile it in. My new kernel is happily running away and jinzora is running as fast as ever.

August 14, 2007

jdk update

Category: Linux — Josh @ 7:15 pm

Not much today… I updated the version of the sun jdk installed on my server. I downloaded the last version of the sun jdk that is compatible with the etch make-jpkg build scripts. It happens to be jdk-1_5_0_11-linux-i586.bin. Making the debian package is as simple. Ensure that fakeroot, make-jpkg, and Java-common packages are installed, then issue the following command;

xxxxx@xxxxx:~$ fakeroot make-jpkg jdk-1_5_0_11-linux-i586.bin

Go through the license agreement and wait for the package to finish building. I purged out the old version of the jdk;

xxxxx@xxxxx:~$ sudo dpkg –purge sun-j2sdk1.5

After the package is completed install it.

xxxxx@xxxxx:~$ sudo dpkg –install sun-j2sdk1.5_1.5.0+update11_i386.deb


Updated the server

Category: Linux — Josh @ 6:09 am

I was importing some MP3’s into jinzora when one of the disks in the root filesystem mirrored disk array dropped out of the array. I was forced to to a hard reboot as i could not shutdown gracefully. Upon rebooting, I upgraded the kernel to the latest debian stable version which is 2.6.18+6, then added the disk back to the array by using the following commands

Use the –examine switch to check the status of the array on the drive (if mdadm can not print the contents of the md superblock in this partition we know it is badly broken.)

mdadm –examine /dev/hdg2

Use the following command to hot-add the partition back to the array.

mdadm /dev/md1 -a /dev/hdg2

Use the following command to check the status of the array rebuild.

cat /proc/mdstat

It took over an hour to rebuild the array, but it has been fine since. I will keep an eye on it.

I also did some tweaking on the OS based on the information in the following post from forums.debian.net

June 12, 2007

wrt54gl update

Category: Linux — Josh @ 11:19 am

I installed x-wrt extensions on the router this morning. It is pretty neat. I also setup the QOS scripts so that I can priortize data packets. This should help with game play while miftik is streaming TVU, or downloading something.

June 6, 2007

Linux on wrt54gl

Category: Linux — Josh @ 8:59 pm

I installed OpenWrt on my linksys wireless router today. The install is wicked easy. It has a basic iptables ruleset, and with the processor in my router it should be able to handle a much more complex ruleset. We will see once I start setting up the ruleset. So far, I have setup ntpclient package and set it up to sync with my linux server on my local lan. I am looking into setting up QOS so that Miftik can pull down newsgroup feeds and I can still play battlefield without getting lag. Another interesting thing is the combined dhcp/dns daemon package. I think the capabilities of the daemon are really cool.

I have not really had the patience today to work on doing much else with it. My thoughts have been wandering a lot, and I can’t seem to concentrate on anything, so I have just been playing Battlefield 2142

May 7, 2007

Ubuntu Fun

Category: Linux — Josh @ 4:58 pm

I have been playing around with optimizing ubuntu on Miftik’s laptop today. I found the following information today and have tweaked/tuned. Now the laptop is booting faster and is generally more pleasant to use.

http://ubuntuforums.org/showthread.php?t=89491&highlight=ubuntu+tip https://wiki.ubuntu.com/Teardown http://www.xsol.se/index.php/2007/04/29/feisty-performance-fly-like-a-butterfly/ http://tvease.net/wiki/index.php?title=Tweak_ubuntu_for_speed