Friday, November 20, 2009

Solved/Enhancement: Fedora 11/Fedora 12 Speed Improvement for YUM updates

Context:
The typical mechanism for updating (or even upgrading) Fedora 11 and Fedora 12 distributions is through Yum and/or it's graphic user interface counter-part gpk-update-viewer. In brief, Yum collects local installation information and comparies it to available updates through a series of mirror sites holding updates for Fedora installations.


Problem:
While running a Beta version of Fedora 12, at some point most the mirror sites that provided Fedora 12 with updates stopped working for me. And, because these sites were scattered around the world, it took a while for Yum to look through all of them to find one that worked.


Constraints:
None


Details:
It's not clear why the mirror sites stopped working. Some reported "404" errors, some "50x" errors and some returned unknown result codes. Eventually, either by retrying or getting lucky, Yum would succeed. I suspect that as Fedora 12 beta moved to Fedora 12 official release, some testing sites for upgrades were taken down.

Note: this problem also affected the GUI front end for Yum: gpk-update-viewer.


Solution:
  1. As an initial step, I executed su -c "yum clean all". I do not know it this assisted with the process of correcting the issue but it is worthy of noting.
  2. Next I executed su -c "yum install yum-fastestmirror". After a few tries, the package as located and installed.

Results
:
On the next yum action, I found the following output:
Loaded plugins: fastestmirror, refresh-packagekit
Determining fastest mirrors
* fedora: fedora.xxxx.xxx
* updates: ftp.xxx.xxx
Setting up Update Process
...
Where the xxxx sites were geographically closer to my current location than the previous sites and were working as Yum expected. The completion of this Yum action and subsequent others was much faster and error free.


References:


Disclaimer
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor your results of your actions should you act on what you read here. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this (and most) free information.

Friday, August 28, 2009

(Followup) Fedora 11: TCP Performance Tuning [script available]

Context:
Using Fedora 11's default installation configuration, reliable network services are provided.

Problem:
No specific issue but performance-related improvements investigated. TCP settings, set for very small "data windows" (small packet sizes), require more packets, creating more network traffic. If set too small, the overhead for sending more packets could cause slower network performance and possibly higher CPU usage.

Constraints:
I had no specific constraints, although I did want a solution that did not require installation of third-party software or other non-standard elements for a Fedora 11 distribution.

Details:
For root or super user accounts, most Linux installations offer access to TCP settings. These settings tell the network card (NIC) and Linux kernel how to manage transmission data. By adjusting these settings, you can affect how much time the computer and NIC spend at these various networking tasks.

Solutions:
After doing some research, I found this site which describe changes that would or could improve network performance. Since I needed to apply these changes on more than one computer, I decided to script the process. Also, since this task was mostly a new domain for me, I decided to backup the existing TCP settings before writing new TCP settings.

The results is a "simple in nature" script for improving TCP performance. Rather than posting an almost 200 line BASH script on the blog, you can get it from this link:
In general terms, this script increases the size of the TCP packets being sent. There are other features enabled which I did not fully research, most explained in the first resource link.

Script Features:
  1. Supports -h and --help command line arguments to get limited help
  2. Simple to use: just execute the script and follow the directions (mostly pressing the space bar or CTRL C to quit)
  3. Confirms necessary tools are available before starting the process
  4. Backs up current settings into a uniquely named file [default name provided, uniqueness handled by the script and reported to the user]
  5. Backup file is formatted (but not tested) to be executable for restoring previous settings
  6. Detects the currently "in use" NIC to make any card-specific setting changes
  7. Requires root via sudo access to execute changes. (not required to perform the setting backups)

Note:
Read this script thoroughly before executing it. If you do not understand it or you are not comfortable with it, I strongly suggest you do not execute it. This script was designed specifically for Fedora 11 distributions and it may or may not work on your Linux distribution. This script is platform-specific and is not expected to work on any other platform (i.e. Windows, Mac, etc)

Results:
I did not develop a metric for testing the results before hand. Here are my subjective observations afterward:
  • Web: it appears that before the changes I could sometimes see web pages loading individual elements. After it appears that web pages "snap" onto the screen quickly.
  • SSH: appears to have no significant impact on SSH. This most likely do to two issues with SSH it's self: limited packet size and single-threaded (de)encryption services.
  • Downloads (web): I don't have any specific impressions of previous speeds but I believe there is an improvement. I have a good ISP so I am seeing 1.7M (peaking at 2.2M) transfer rates per second from a relatively close-by commercial site, which seems higher than before.

References:
Additional reading here:

Disclaimer:
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor your results of your actions should you act on what you read here or execution of the script I provided for this blog entry. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this (and most) free information.

Followup (August 30, 2009)
It appears that the default settings in the provided version 0.2 script may have introduced an issue with some web sites, most noticeably with streaming audio and video with Flash. Using a previous configuration I used that didn't appear to have this issue at the time, I have updated the script (0.4) with some less aggressive settings. This update also has a more execution-friendly backup file format. Additional testing so far seems more consistent.

Followup (September 2, 2009)
The problems I experienced seems to be related to a kernel update for Fedora 11. More details here:
As the problems I experienced are not related to the TCP Tuning, I plan to update the script to support multiple types of settings from minor to aggressive TCP tuning.


Followup (September 3, 2009)
I have updated the tcpTuning.sh script to 0.5. I have added 3 different tuning profiles:

  1. -0 = tune TCP performance to near-default installation settings
  2. -1 = tune moderate TCP performance settings
  3. -2 = tune aggressive TCP performance settings
tcpTuning.sh still supports -h and --help in case you forget these options.

Sunday, August 24, 2008

(Followup) Solved: Fedora 9 default settings for shared memory /tmp

Context:
Using Fedora 9's default installation configuration, the "temp directory" (using another OS's terms) is utilized as /tmp. This special directory is a shared file system and resides in memory known as tmpfs.

Problem:
The default settings for a tmpfs is half of the available memory.

Constraints:
Fedora 9's default set up uses an in-memory solution for /tmp.


Details:
My system has 2 gigabyte of memory. However, the average usage for /tmp on my machine is less than one 1 megabyte. So, more then 1023 megabytes of memory was allocated and never used.

Solution:
I needed to control the size of the /tmp. This is mounted at boot time using the description in /etc/fstab. After a forum search, I looked at the man page for the mount command to determine the need to use the size option during mount /tmp. I decided to try only having 2 megabytes for /tmp.

Original /etc/fstab:
tmpfs    /dev/shm    tmpfs    defaults    0 0
New fstab:
tmpfs    /dev/shm    tmpfs    defaults,size=2097152    0 0

After making these changes as super user or root, I rebooted my system to get th e settings to become active.

References:

Note:
The other options for providing /tmp are:
  1. disk based /tmp, mounting (via /etc/fstab) a disk partition at boot time (preferred)
  2. directory based /tmp on the boot root partition (not preferred for security reasons)

Disclaimer:
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor the your results of your actions should you act on what you read here. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this (and most) free information.

Followup (July 26, 2009):
A simpler way to control the /tmp size through the /etc/fstab is using a percentage:

In fstab:
tmpfs /dev/shm tmpfs defaults,size=10% 0 0

Saturday, July 12, 2008

(Followup) Solved: Fedora 9, Skype for Linux 2.0x and the Microphone

Context:
Using Fedora 9's new sound system Pulse, some sound-centric applications like Skype need to be configured differently from their default sound settings.

Problem:
Immediately after installation, Skype for Linux 2.0.x was able to connect to my account and I was able to hear the test calls with reliable clarity.

However, using the Skype Test Call, my microphone sound was very distorted with static, digitalization, and gaps. Enabling the "Display technical call info", showed very high "jitter" and some "cor" (assuming this means corruption) but a reliable connect speed.

As I was able to use Skype for Windows before moving to Fedora 9, I was able to remove the router as the cause of the problem. See the "jitter" for details if you think this might be your problem.

Constraints:
Fedora 9 uses the "Pulse" sound daemon. Skype is a closed ("black box") software application so it's constraints are vastly unknown.

Details:
While I was able to use my microphone without significant issue (the volume was a little low) with other applications ( Sound Recorder ), Skype did not provide a clean and clear sound processing from the microphone. I tried various solutions (listed below) before finding the correct one for me:
Note: After trying each of these solutions and each failed to solve the problem, I reversed most of changes before starting the next solution. I believe I left some of the solutions from the first reference in place.

Solution:

The solution what worked for me came in two parts:
Enhancing the Microphone Volume

Takes from the second post here:
"A. Right click at the volume control, choose preference.
B. File - Change Device - (OSS Mixer), which is the second one.
C. Below the microphone volume- click on the "microphone icon" until there is no cross on it.
D. File - Change Device - (Alsa Mixer), which is the first one.
E. Edit - preference - scroll down - click Mic Boost (+20 dB)
F. Click "Switches", which is next to Playback. Then click Mic Boost (+20 dB)"
This will result in a louder microphone for all of Fedora 9's sound applications using the microphone. If you find that it's too loud, you can unselect the microphone boost on the "Switches" panel of the sound mixer.

Setting the Hardware Microphone in Skype

Taken from the here:
"Firstly, add these lines:
default-fragments = 8
default-fragment-size-msec = 5

at the end of "/etc/pulse/daemon.conf"

Then, edit "~/.asoundrc" and add the following lines if they do not exist:

pcm.pulse { type pulse }
ctl.pulse { type pulse }

Finally, open Skype. Set the "Ringing" and "Sound Out" devices to "pulse", then set the "Sound In" to the plughw device of your microphone."

While the article has more steps, these are the only steps I executed from this reference.
  1. I added the first modifications to /etc/pulse/daemond.conf as shown. I am uncertain exactly what these settings do.
  2. I did not have a ~/.asoundrc file. I created on in my home directory but I do not think it added to the finally solution.
  3. I believe the key part of the solution was the last step (possibly the only step needed): "set the 'Sound In' to the plughwd device of your microphone." The Skype "Sound In" settings are found on the Options dialog under "Sound Devices". Using the drop down box "Sound In", I did a bit of "trail and error" to find the correct setting and required a restart of X when I selected some of the incorrect options. In the end, my correct setting was "Intel ICH5 (hw:ICH6,0)" and yielded a very clear voice using the Skype Test Call" service. Your setting will probably be similar but different.
  4. From other experimentation, I set the "Sound Out" and "Ringing" to "pulse".
References:

Disclaimer:
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor the your results of your actions should you act on what you read here. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this (and most) free information.

Followup (July 26,2009):

Based on experiences with Fedora 10 and Fedora 11, the above suggestions are not absolute. In fast, they only highlight the "control points" but generally will not solve the problem. During subsequent testing, I found that a change in configuration required a reboot to truly get a definitive result. For Fedora 11, I finally gave up and configured directly against the hardware layer and not with PulseAudio.

Monday, June 23, 2008

Solved: Restoring the Master Boot Record (MBR) to the boot drive

Context: Missing or corrupted Master Boot Record (or MBR) can and usually will prevent booting a computer.


Problem: Having botched a Linux installation, the Master Boot Record (MBR) was destroyed. To recover and boot the computer again, the MBR must be restored to work order.


Constraints:
  1. No floppy drive
  2. BIOS doesn't support USB booting
  3. CD ROM limited on ability to read different CDs
  4. Windows booted from the MBR directly so I could not use Microsoft's fdisk
  5. Lilo was not found on the Fedora 9 Live CD
  6. Grub-install on the Fedora 9 Live CD did not function according to expectation

Details: Installing Fedora 9 Live CD to an Dell Latitude C600, I didn't allow enough room for the Live CD install (I misremembered options for a selective install.) Additionally, a previous GRUB installation on the Master Boot Record was not clean off before installation started. Near the end of the installation, an error occurred (out of space.) The result was a damaged MBR record. The exact cause of the damage was not known.


Solution: Restore MBR from

  1. Boot Fedora 9 Live CD
  2. Confirm presents of file usr/lib/syslinux/mbr.bin
  3. Open a Xterm or other shell
  4. Log in as root or superuser
  5. Umount the targeted drive partition. In my case:
    • umount /sda1
  6. Write the replace MBR to the drive:
    • dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda bs=1
  7. reboot

Note!: This was a "long shot" action on my behalf and thus a risk on anyone following these instructions. The contents of the file mbr.bin were a guess on my part as was the correct use and application of dd. While this works, you should know that your results may vary greatly. Use these instructs only as a last resort! Please read the disclaimers section.


References:

Disclaimer:
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor the your results of your actions should you act on what you read here. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this
(and most) free information.

Sunday, June 22, 2008

Solved: Adding NVidia Support to Fedora 9

Context: Installing correct, high performance NVida drivers for Fedora 9.


Problem: The default video drivers provided by the Fedora project work fine. However, enhancements such as 3D Desktop are only available with updated drivers. If you do not have an NVidia video card, this blog entry may not assist you with video card concerns.


Details: The Fedora project is stated that is wishes to avoid any contentious software, either from ownership or patent concerns. NVidia is a privately own company and thus their video drivers appear to fall under this concern. See the first link in the reference section for more details.


Solution: Add an additional third-party repository to your "Update Sources":
  1. Do a full system update with existing installed software
  2. Go to http://rpm.livna.org/rlowiki/
  3. Download Fedora 9 repository RPM and install it
  4. Perform an "Update System", search, and install "akmod-nvida-xx", where xx is the latest (or last known good) version of the drivers.
  5. Follow the directions after the installation. I usually reboot after large installations since Fedora 9's update mechanism does not seem to be notifying or enforcing reboot-needed rules.

Note: the Livna source provides other package updates that Fedora 9's default repository sources do not provide.

Note: In general, adding additional repository sources is a security risk and should be under taken with this in mind.

Note!: I would advise that you limit the inclusion of software from third-party sites to only those specific items you want and only if they are well separated from other elements of your operating system. You can easily have conflicts between different built libraries which can cripple your operating system in the matter of a few button clicks. Know what you are installing, where it's from and how it will (or won't) "Play Nice" with other elements.


References:

Disclaimer:
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor the your results of your actions should you act on what you read here. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this
(and most) free information.

Saturday, June 21, 2008

Solved: Booting Fedora 9 Live CD on Dell Latitude C600

Context: Booting Fedora 9 Live CD on Dell Latitude C600

Problem: split screen into 2 or three panels at 800x600.

Details: Fedora 9 Live CD detects built-in video card as "ATI Rage 128 M 2G and display type as "Autoconfigured".

Solution:

Note: this solution requires you to "deal with" the incorrect video settings for a brief period of time.

  1. Boot from Fedora 9 Live CD and log in to default login

  2. If the the screen is divided into sections and generally not working, continue. If it's perfect, you're done. Don't make any changes based on what I say in this blog entry.

  3. Move Application panel to left hand side. This will allow you to see more of the menus. Do this by clicking in the grey area next to the mail icon, click and drag to the left side of the screen.

  4. Go to menus "System | Administration | Display", then the "Hardware" tab. Make the following changes:

    • Display: "LCD Panel 800x600"
    • Video Driver: "Vesa -Generic VESA-compliant video cards"
    • Press Ok to commit these changes

  5. Press keys CTRL ALT BACKSPACE to restart the X Window System only.
    • Do not reboot - any changes made will be lost during a reboot as they only reside in memory.
After you log in again, I was (you might be) able to see the screen correctly.

Note: I tried "LCD Panel 1024x768" the first time with no positive results.

References:
I located some information, ideas, clues or inspiration from the following locations. I am not responsible for external content nor it's availability:
  1. http://ubuntuforums.org/archive/index.php/t-769002.html

Disclaimer:
This solution worked for me. It may or may not work for you. I am not responsible for your actions nor the your results of your actions should you act on what you read here. I do not claim expertise in this very specific area and only convey my experience. There is no warranty on this
(and most) free information.