Friday, March 18, 2011

Customize your Linux application environment (1)

Author: Cao Jiang hua is based on open source Linux users provide such a platform: depending on your software and hardware environment, customize your Linux application environment.

Thus, according to each user to different application scope custom application environment, you can set the Linux system performance to new heights. Custom Linux system service at boot time, you need to start many system services to local and network users with a Linux system functions interface, directly facing the applications and users. However, unnecessary or vulnerable services will bring security to the operating system and the effect on performance. For system security, if any of the operating system vulnerabilities that are likely to make the entire system. Therefore, increase system security, the best way is to monitor the system's functionality. As regards the choice of the number of services and features, according to the needs and capacity to work. The following run as root: # ntsysv figure 1 does not need to service and process preceding * remove open as shown in Figure 1, where you can turn on/off for every system service (for example by RedFlag3.0). You will not need to service and process preceding * removed (with the SPACEBAR), and then restart the system so that you can make the unneeded services and process no longer start. This way you can at any time in accordance with the needs of the customization system services, guarantee safety, but also can improve system performance. To protect the Linux to work, some system services must start, for example, the crond, syslog, keytable, nfs, kudzu. In order to efficiently and securely customize system services, the following items describe the system service functions. AlsasoundAlsa audio driver support. Alsa sound drivers would have to a sound card GravisUltraSound (GUS) and write it and OSS/Free and OSS/Linux compatible. Apmd used to monitor the system power state, and the related information write through syslogd logs can also be used to shut down the power supply is low. Generally used for laptops, desktops, recommends to shut down. Atd with At command schedules tasks, also in system load is relatively low when running the batch job. Auto-autofs reproduced when needed, the file system does not automatically uninstall when needed. Chargen port chargen-character abbreviation, the output produced by one of the printable characters, rotating sequence for testing character terminal equipment. Chargenudpudp format port of abbreviation chargen character, output a printable characters of the rotation sequences for test character terminal equipment. Crond according to user requirements cycle to run scheduled tasks. It is more secure, easy configuration, similar to the Windows scheduled tasks. Dhcpd provide dynamic host control protocol (DynamicHostControlProtocol) access supportive. Echo port to respond to all echo simple to test the connection to its data. Echoudpudp format port echo simply responding to all to test the connection to its data. Gpm to text mode Linux programs, such as MC (MidnightCommander) provides mouse support. It also supported the console mouse copy, paste and the pop-up menu. Inetd Internet operations services program. Monitor network management service needs and, where necessary, start the appropriate service process. Typically, the management of the program have inetd telnet, ftp, rsh and rlogin. Close the inetd will turn off these services by its management. It is a famous http WWW server, can be used to provide HTML files and CGI dynamic content services. Isdnisdn daemon. The program features keytable is reproduced in the notes of the keyboard/etc/sysconfig/keyboards mapping table. The table can be selected by kbdconfig tool, you should make the program is activated. Kudzu is a hardware detection program, and the Windows of the add new hardware. If the system core support the hardware and the drivers, you can automatically mount. Linuxconf it is Linux a valid system configuration tool that allows remote operation. Linuxconfweb in Web mode use linuxcon. Lpd system printing daemon, responsible for lpr, the program is submitted to the print job. Medusa Web-browser. Mysql is a fast and efficient reliable small SQL database engine. Ntalk allows the user to your own computer and other computers, and then move forward or backward to transfer information. Netfs is responsible for loading/unloading NFS, Samba, NCP (Netware) file system. Network to activate/disable startup of each network interface. Nfs is a popular, based on the TCP/IP network file sharing protocol. This service provides NFS file sharing services, the specific configuration file in/etc/exports. Nscd this service is responsible for passwords, and group queries, and buffering the results of the query. If the system has a slower service (such as NIS and NIS +), you should start the service. Pxe for remote diskless linux system launch services program. Pcmcia is used primarily to support the laptop. Rexec it is a secure, decentralized implementation of remote systems to parallel computer clusters and run continuously. Random save and restoreSystem of high-quality random number generator. These random numbers are some random behavior by the system. Routed the daemon supports RIP protocol automatically the IP routing table maintenance. RIP the main use in small networks, the larger the network requires complex protocols. Rsync superimposed FtpServer, allows the cycle check. Rsh remote host starts a shell, and perform the user command. Rwhod allow remote user access rwho daemon running on the machine all the logged on user list, and finger. A toolkit, swatSamba use 901 port. Sendmail mail server. Smb boot and shutdown smbd and nmbd daemon to provide SMB network services. Snmpd simple network management protocol (SNMP) daemon. Syslog is the operating system provides a mechanism for daemons usually use this mechanism to all kinds of information written to the system log file. Usually you should start the service. XfsX-Window system font server. Xinetd is inetd inherited service, monitoring network to various management service needs and, where necessary, start the appropriate service process. These system services, the security risk is quite big: rsh, rwhod, rexec, snmp, named, sendmail. For a real need of system services, should try to use the latest version of the program, and other security precautions. In addition, many Linux product in the system after initialization by default start X-Window manager. If you compile your program or edit the configuration file, then start X-Window manager will consume a large amount of system resources. Disable X-Window manager by editing the file, locate the content/etc/inittab to ID: 5: initdefault line, change it to ID: 3: initdefault after system restart will provide command line login. When you need to run X-Window manager, just enter startx. Depending on your hardware to optimize 1.CPU CPU is Linux hosts core hardware, according to CPU type at compile time, optimized for best performance. In/etc/profile file, containing system environment and start the program configuration information, use-O9 to compile, run speed is the fastest. Compile-time use-fomit-frame-poinetr option, the program run-time access to variable uses the stack. Use the-mcpu = cpu-type and-march = cpu-type, gcc will be optimized for CPU models. If the CPU is PentiumPro, P e n t I u m e n Ⅱ, P t I u m Ⅲ, AMDK6-2, K6-3, Althon, "adding:"/etc/profile CFLAGS = '-O9-funroll-loops-ffast-math-malign-double-mcpu = pentiumpro-march = pentiumpro-fomit-frame-pointer-fno-exceptions ' if the CPU is the Pentium, PentiumMMX, AMDK5, IDT, Cyrix, "adding:"/etc/profile exportCFLAGS =-O3-march = pentium-mcpu = pentium-ffast-math-funroll-loops-fomit-frame-pointer-fforce-mem-fforce-addr-malign-double-fno-exceptions 2. hard drive using UDMA/33, 66, 100, 133 technology hard drive, the maximum transfer rate is 33MB/s, 66MB/s, 100MB/s, 100MB/s. Theoretically, it is an IDE hard disk (this refers to the transfer rate PIOMODE4 mode is 16.6MB/s) transfer rate of 3 to 6 times, but in Linux default settings, the DMA is disabled, so it must be open. We can use/sbin/hdparm program to open it. Hdparm in some common options are as follows:/sbin/hdparm-c1/dev/hda or hdb or hdc and so enable PCI bus on a 32-bit I/O mode to transfer data. /Sbin/hdparm-d1/dev/hda enable DMA mode for data transmission. /Sbin/hdparm-d1-X66/dev/hda UltraDMA mode data transfer is enabled. Gets the current hard disk drive in the system settings list is (as root) type: $/sbin/hdparm/dev/da then enter the command: $/sbin/hdparm-kl/dev/da after Reset hard drive to remain above settings. Everything after the optimization to the best State, the command Add to/etc/rc.d/rc.local file, so that the commands in each time you run automatically when the system boots. 3. memory in Linux using free you can observe the memory usage. If you find that Linux can only use one part of it, then in/etc/lilo.conf to append = "mem = XXX", where XXX can be physical memory capacity. This way you can tell Linux use all memory. IfFruit on the calculation speed is high, can be achieved by increasing the memory to use ramdisk technology. A ARamDisk is assumed to be a hard drive, memory, and it stores the file. Suppose there are several files to frequent use, if they are added to the memory, the program will greatly increase the running speed, because the memory read/write speeds much higher than the hard disk. Set aside some memory to improve overall performance, no more than to replace the new CPU. Such as the Web server computer, require a large amount of read and Exchange-specific file. Therefore, on the Web server, create RamDisk would significantly improve network read speed. $ Mkdir/tmp/ramdisk0 $ mke2fs/dev/ram0 $ mount/dev/ram0/tmp/ramdisk0 above these three commands will RamDi

No comments:

Post a Comment