显示标签为“optimization”的博文。显示所有博文
显示标签为“optimization”的博文。显示所有博文

2007年6月21日星期四

Make your gnome menus run faster

Some weeks ago, I have showed two small tips to tweak your Ubuntu Linux. The first one is to disable IPv6 and the second one is to reduce swapping. Today, I have another tip to make your gnome menus run faster.

1. Create a file named .gtkrc-2.0 in your home directory

cd
touch .gtkrc-2.0
echo "gtk-menu-popup-delay = 0"| tee -a .gtkrc-2.0

2. Logout and login again

I have tested with a value gtk-menu-popop-delay = 2000 before to try gtk-menu-popop-delay = 0 to see what is different in effect.
read more

2007年6月13日星期三

Tune Boot-Up-Manger for better performance of Ubuntu

Ubuntu does not come with a graphical tool to disable services. The Boot-Up-Manager (BUM) is the most comprehensive and user-friendly tool for Ubuntu.

Follow these Steps to Install Boot-Up- Manager

  • Go to Applications > Add and Remove Applications


  • The Add/Remove Applications window is shown. Search for boot in the search text box. Check Boot-Up-Manager and click on OK to install.

  • Click on Apply in confirmation popup. Boot-Up-Manager is installed successfully.


Disable the services for better performance tunning

  • Go to System > Adminstration > BootUp-Manager


  • Boot-Up-Manager window is shown. Check Advanced check box, and select tab Startup and shutdown scripts


Disabling the below listed scripts doesn't disturb your PC
  • ntpdate: a utility that updates the system clock on each reboot.

  • pcmcia: used only with laptops if one has PCMCIA cards.

  • ppp: point-to-point protocol used only if you have a modem. Disabled the built-in modem in my desktop and only use a network interface card.

  • powernowd: Use an AMD processor with Ubuntu and this service does not work with AMD.

  • rsync: a utility that provides fast incremental file transfer if you wish to mirror or back up data.

  • fetchmail: a utility to retrieve and forward mail and act as a gateway to smtp. If you are a Linux groupware client, do not use this utility.

  • postfix: a mail transfer agent similar to sendmail. Use a mail server from my ISP and our company domain.

Reboot the PC and find the difference.

2007年5月31日星期四

HOWTO: Cleaning up all those unnecessary junk files in ubuntu!

this article shows you how to get ri of those unwanted files taking up space in your Ubuntu folders.



read more | digg story

2007年5月27日星期日

Make your firefox more beautiful in ubuntu!

One thing that has always bothered me about Ubuntu's firefox is that the buttons, radio buttons, drop down menus, text fields, and checkboxes (known as widgets) are very cruddy looking. Fortunately I found a simple way to fix this. What we have below is a replacement set of images and CSS code for the widgets which will make them much nicer on the eyes (see bottom of the post for screenshots).


The original widgets are done by Osmo Salomaa . I have written a bash script to make the installation and removal process easier. You can download this at the bottom of this post. Simply unpack the archive anywhere you like, open a shell, cd to the directory you unpacked and run install (do this with the ./install command). Now you are presented with a menu.

By default this script works with the default firefox directory: /usr/lib/firefox. To work with a different directory (such as /usr/local/firefox32 if you are using Kilz's firefox32 package) you can specify a new installation/removal (option 3). Make sure you enter the correct path to your firefox directory. You can also change the installation/removal directory with the "-p=" or "--path=" command line options when you initiate the script (run ./install --help or read the README for more information).

Once you have the correct path (or you are just using the default /usr/lib/firefox path), you can install by using option 1 in the main menu. To run the installer immediately and bypass the menu use the "-i" or "--install" command line options when executing the script. Use the "-h" or "--help" command line options to get more information (./install -h).

To remove the widgets (make sure you have the correct path first just like with installing), just select option 2 from the main menu. If you wish to bypass the menu and go straight to removal, envoke the "-r" or "--remove" option.

You can also use the "-p=" option in conjunction with the "-r" or "-i" command line options if you like.

Example) ./install --path=/usr/local/Iceweasel32 -i
This would install the widgets to the /usr/local/Iceweasel32 directory.

I should also mention, I have included a backup forms.css file incase you mess anything up. This file is from a default 64-bit Firefox 2.0 installation. The forms.css file an be found in Firefox's "res" directory. You won't need my backup unless you accidently delete your's or the script malfunctions (in which case please contact me).

Read the README for more information. Screenshots are below, enjoy!


Buttons


Check Boxes


Radio Buttons


Drop Down Menus


Text Fields


Before


After

Download script:http://www.mediafire.com/?8xs20zmmrhv
Read more

2007年5月19日星期六

Tuning Kernel Parameters

Many of the tunable performance items can be configured directly by the kernel. The command sysctl is used to view current kernel settings and adjust them. For example, to display all available parameters (in a sorted list), use:

sudo sysctl -a | sort | more

Note: There are a few tunable parameters that can only be accessed by root. Without sudo, you can still view most of the kernel parameters.

Each of the kernel parameters are in a field = value format. For example, the parameter kernel.threads-max = 16379 sets the maximum number of concurrent processes to 16,379. This is smaller than the maximum number of unique PIDs (65,536). Lowering the number of PIDs can improve performance on systems with slow CPUs or little RAM since it reduces the number of simultaneous tasks. On high-performance computers with dual processors, this value can be large. As an example, my 350 MHz iMac is set to 2,048, my dual-processor 200 MHz PC is set to 1024, and my 2.8 GHz dual processor PC is set to 16,379.

Tip: The kernel configures the default number of threads based on the available resources. Installing the same Ubuntu version on different hardware may set a different value. If you need an identical system (for testing, critical deployment, or sensitive compatibility), be sure to explicitly set this value.

There are two ways to adjust the kernel parameters. First, you can do it on the command line. For example, sudo sysctl -w kernel.threads-max=16000. This change takes effect immediately but is not permanent; if you reboot, this change will be lost. The other way to make a kernel change is to add the parameter to the /etc/sysctl.conf file. Adding the line kernel.threads-max=16000 will make the change take effect on the next reboot. Usually when tuning, you first use sysctl –w. If you like the change, then you can add it to /etc/sysctl.conf. Using sysctl –w first allows you to test modifications. In the event that everything breaks, you can always reboot to recover before committing the changes to /etc/sysctl.conf

2007年5月18日星期五

Optimize Ubuntu Feisty Fawn for Speed - Tips for a faster Ubuntu machine!

来源
If you use Ubuntu (Feisty Fawn) as your Linux distribution, which everyone knows it's a pretty fast Linux operating system, you can also do some tricks in order to get a boost. I will teach you today some quick hacks on how to improve the overall performance of your system.

WARNING: Please follow the instructions below very carefully, in the order in which they are listed below and reboot your machine after each one. If not, your operating system will NOT work anymore.

1. Boot tweaking

It is a very good idea to do this tweak when you first install Ubuntu, but you can also do it anytime after the installation. This will reorganize some files that are read when the computer boots and it makes the boot process a little faster. All you have to do is hit the ESC button to see the GRUB menu when the computer starts, then select the second line (the one that looks like this: /vmlinuz-2.6.20-15-generic root=UUID=6162302f-3f32-4b73-bb56-c42f4f9fbce2 ro quiet splash) and hit the "e" key to edit that line. Add the word profile at the end of this line (don't forget to put a space before you type profile). Hit enter when you're done and then push the "b" key on your keyboard in order to boot the system.

It will take a little longer to boot, but only this one time, because after this process it will boot faster.

2. Filesystem tweaks

The following tweaks are for EXT3 and ReiserFS filesystems

Open a console and type:

CODE

sudo gedit /etc/fstab


Add the following options marked in bold to the root (/) mount line. In other words, it should change from this:

# /dev/sdb2
UUID=f4d4d73d-4141-4701-a7e2-ec41664483a7 / ext3 defaults,errors=remount-ro 0 1

into this:

# /dev/sdb2
UUID=f4d4d73d-4141-4701-a7e2-ec41664483a7 / ext3 defaults,errors=remount-ro,noatime,data=writeback 0 1

Now type the following command in the console:

CODE

sudo gedit /boot/grub/menu.lst


And add this option:

rootflags=data=writeback

to the end of the following lines:

# defoptions=quiet splash rootflags=data=writeback

# altoptions=(recovery mode) single rootflags=data=writeback

Now save and close, and type the following command in the console:

CODE

sudo update-grub


Type now the following command in order to manually change your filesystem "on-the-fly" into writeback.

NOTE: Please note that /dev/sdb2 is my root (/) partition. If you have the root (/) partition in another place, change it accordingly. Please look in /etc/fstab for this!

WARNING: The next trick is only for EXT3 filesystems! For ReiserFS this will NOT work, so don't run the following command, just reboot your system for the changes to apply.

CODE

sudo tune2fs -o journal_data_writeback /dev/sdb2


That's all, now reboot your system and when you get back, you should feel an increased speed in video, image or audio usage.

3. Tuning Swappiness

If you have been running Linux systems for some time and you have used applications like 'top' to see what's going on in your machine, then you've probably wondered: Where has all my memory gone? You should know that the largest place is being used in the disk cache, as the cached memory is free and it can be replaced anytime if a newly started application needs that memory. Linux systems are made like this to use so much memory for disk cache because the RAM is wasted if is not used and if something needs the same data again, then there is a very good chance to be in the cache memory.

In a console type the following code:

CODE

sudo gedit /etc/sysctl.conf


Now add the following line at the end of this file:

CODE

vm.swappiness=0


The number at the end of this line can be between 0 and 100. At 100 the Linux kernel will prefer to find inactive pages and swap them out, while value 0 gives something close to the old behavior where applications that wanted memory could shrink the cache to a tiny fraction of RAM.

4. Concurrent booting

If you have a dual-core processor or one that supports hyperthreading then concurrent booting allows Ubuntu to take advantage of them. Just open a console and type the following code:

CODE

sudo gedit /etc/init.d/rc


and find the line CONCURRENCY=none and change it to:

CODE

CONCURRENCY=shell


Save and reboot your computer.

5. IPv6 tweaking

In Linux, most of the installed software uses the IPv4 Internet protocol in order to connect to the internet and because the IPv6 protocol is enabled by default in Ubuntu, you must create a file to block this protocol. Type the following code in a console:

CODE

sudo gedit /etc/modprobe.d/bad_list


and add the next line in that file:

CODE

alias net-pf-10 off


Remember to hit enter after you've added the above line, save and exit.

That will be all for now, please report if you see any improvements to your system. If anyone has more improvements, you can post them here anytime, so others will know about them!