Although most people know that FreeBSD has high stability, good network performance, but some technical features of FreeBSD, there are still some deviations in understanding.
1.FreeBSD does not have a log file system, so it is not suitable for use as a high requirements
First, it is important to point out that the log file system is also developed on the BSD, called LFS. It was originally supported in FreeBSD, but later due to version upgrades, its code was temporarily abandoned due to lack of maintenance, and some of the LFS can be found in FreeBSD source code. Currently, LFS is still in NetBSD to continue development, if there is a special demand, it can be quickly returned to the FreeBSD system.
However, FreeBSD developers are not ruthless to transplant LFS back to FreeBSD, because some new features have been added in the FreeBSD system, enough to provide the most important features available by LFS. In order to explain the essence of these features of FreeBSD, we need to discuss the file system.
Since the read and write performance of the file system is a very important indicator for the performance of the entire system, the system designer tries to improve the performance of the file system as much as possible. In this way, people have designed a disk access buffer to achieve this, thus, using the buffered read / write method is called asynchronous (ASYNC) access method, the corresponding non-buffer disk read / write method is called synchronization (SYNC) Access method.
Obviously, the asynchronous method has higher read and write performance, but once there is a failure, this part of the data is lost due to many data is saved in the buffer. However, if it is a simple part of the data is lost, it is lost, but some important data is lost, it causes the entire file system to be destroyed. Why does this happen?
Because, in the file system, there are two different data, one for simple file content data, which only causes an error data that causes a file, and does not affect other files. Another data is more important, such as the I node or directory data of the file system itself. If the data block of the i node occurs, it will cause a large number of files to be lost, and even the file system is broken. These data on file system integrity is called metadata.
For ordinary file systems, it is not possible to distinguish ordinary data and metadata in the buffer, so that the update of ordinary data is more than the time it corresponds to the metadata update, so once the fault, the file system Destruction is inevitable. For log file systems, since the log is the order of order, the order of the buffer to disk is also sequentially, so that the update of metadata is always saved before the data update, so that even if it is faulty, Metadata does not have a particularly serious error, and some metadata errors can only cause partial file loss without affecting the entire file system.
Due to this sequential characteristics of the log file system, the system does not have a serious error due to the failure, and when an error occurs, there is a shorter file system repair time (FSCK), the system repair time is very large file system. Very important. This makes the system restart and restore the service of the system are also short-lived.
For FreeBSD systems, you can solve this problem along another similar way. Since FreeBSD is more concerned about the stability, reliability, the FreeBSD system does not recommend using asynchronous methods to access the disk, but such disk performance is relatively poor. In order to solve this problem, FreeBSD improves the file system, separating normal data and metadata so that ordinary data can be buffered, and the metadata does not buffer, such a method can greatly improve file system performance, and There is no much impact on the security of the system. However, even if so, the performance of the file system has some gaps compared to all asynchronous methods, how to achieve all asynchronous access? FreeBSD researchers put forward SoftUpdate, the main purpose of SoftUpdate is to change metadata changes according to their dependencies, and metadata reorders the dependencies of ordinary data to ensure metadata updates, updated according to secure data order. This even if there is a fault, it is like a log file system, and some files that eventually change will occur, and there will be serious errors.
From this essential perspective, SoftUpdate is actually two different ways to solve the same class problem, but the log file system is the order of the log file system to solve the order of dependencies, and SoftUpdate needs to re-order the element. Data, SoftUpdate feature is very similar to the metadata log file system. With SoftUpdate, the system can fully support asynchronous disk read and write, provide better file system performance.
In addition, FreeBSD is currently provided, such as a background disk check, that is, a disk check can be performed in the background without affecting the front desk execution disk access, which makes the system failure shorter time to restore normal services. The FreeBSD system can even provide advanced file system features including snapshot.
Therefore, although there is currently no log file system under FreeBSD, the function of similar log file systems has been provided, so it can fully meet the different high-end needs.
2. FreeBSD's disk read and write performance is not suitable for a lot of storage data.
Many articles from the Internet have told readers. FreeBSD has a certain advantage in other respects, but the disk read and write speed is poor, especially when using the IDE disk.
If this view is placed before FreeBSD 2.2.x, it may have some truth. At that time, FreeBSD to ensure the security of the file system, it is to access the disk using the synchronous method, obviously to access the disk slower than Linux, etc. many. But after FreeBSD 3.x, the system has fully supported SoftUpdate, so performance improvements can be seen.
Of course, in order to ensure data security, FreeBSD also turns off some hardware performance options. For example, the IDE disk usually has an internal buffer, which has the function of buffering data on the disk device itself. In principle, this function is very dangerous. Because it is implemented inside the disk, the system cannot tell it that data is metadata, can not buffer or must write, etc., some high-end disks are usually available, ensuring that the buffering energy inside the disk is suddenly turned back. Disk, but ordinary disk obviously there is no ability. Therefore, FreeBSD actually defaults to shut down such functions and is not recommended, but if it is a pursuit of performance, it is also possible to open these functions, but it is necessary to rispitate.
Many FreeBSD users also noted that when installing FreeBSD, disk read and write performance is relatively slow, especially when installing the Ports Collection section. This is because the current version of the freebsd has not immediately supported SoftUpdate. It does not give full play to this performance advantage. For the Ports Collection contains a large number of small files, it takes a lot of disk access to disk access, and the speed is slower is normal. . The future installation system supports the default SoftUpdate and the installation speed will be improved. The disk access of the installation system has a deeper reason, which is to install the packaging method of the system and the normal way, such as a multi-level subdirectory AA / BB / CC / DD, the ordinary package data method is to pack AA first, then It is AA / BB, AA / BB / CC, and finally AA / BB / CC / DD, which is in order when unlocking, but the package method of installing the system is opposite, then, when this is slow The additional processing is required, the more subdirectory levels, the more additional disk access needs. The FreeBSD system uses this packaging method, mainly to ensure that the files in the upgrade are expanded.
The correctness, although there will be no problem in most cases in most cases using normal packaging order.
Even so, in the latest FreeBSD and Linux comparison test (FreeBSD 4.3 on Linux 2.4.10), the same hardware is used, FreeBSD is a few percentage points that are more than Linux, while providing dynamics. CGI is more than a few percentage points higher than Linux. In principle, this shows that FreeBSD has a gap between freebsd in disk I / O.
For this, first, it is necessary to point out that freebsd's SoftUpdate asynchronous mode, and the normal asynchronous way of Linux's EXT2FS is different, and the functionality is very different.
Second, I think this comparative test also shows the differences in FreeBSD and Linux in memory management.
It is well known that FreeBSD and Linux are used to unify the virtual memory page and disk buffer, and assign physical memory dynamics to disk buffers or as virtual memory pages as needed. Such unified management makes the system use different allocation strategies to buffer priority or virtual memory priority? Obviously, FreeBSD will tend to be the latter, which makes Linux a lot larger, and when the disk content needs to be buffered, the access performance of the file system is better. FreeBSD is still efficiently served in the case of heavy loads in the number of processes. This will explain a friend who once gives me a similar test result that uses Apache. In his test, Linux is easy to reach 100% of the processor under heavy load, and FreeBSD is slightly A few gaps, but the processor is occupied by 50%. My friend hopes that I can tell him how to squeeze the remaining processing capabilities of the processor, reach higher performance, but I have to say that this is involved in memory management details. Don't do this. simple. In fact, keep a certain processor empty, enabling the system process to switch smoothing, more stable service, know, performance is not the only factor.
With my opinion, in addition to the case where the data can be found in the buffer, it is also necessary to test the situation that cannot be found. The normal service world is more in line with the real service world, and the normal disk access test usually includes sequential read, sequential written, random read, Random write and so on. For example, thousands of random selection URLs can be used instead of a fixed URL to perform random read tests, maybe the result will be different! 3. Since Wind River has disrupted some employees who make FreeBSD issuance, FreeBSD prospects are not wonderful.
Just recently, Wind River, which is originally produced FreeBSD officially released, will be responsible for making freebsd issues employee dismissal and declares that the future will no longer be responsible for FreeBSD CD issuance and technical support. Therefore, when some friends chat with me, I laughed and talking about FreeBSD.
If you just look at this matter, you may get this conclusion, but if we pay attention to the relationship between Wind River and FreeBSD, and they actually buy BSDI, it is not so simple.
In fact, the earlie version of FreeBSD is responsible for making CD and issued by CDROM.com, CDROM is a publishing production company, not a strict IT company. Later, BSDI, made BSD / OS companies, purchased CDROM, and there was also a manufacturing and distribution department of FreeBSD until Wind River purchased BSDI. It can now be seen that as a company for embedded systems, Wind River only requires BSD / OS to fill the gap in its product line, and under the current IT industry is universal, Wind River is not interested in non-maincoming Work in the field of publication, as a business company is very normal and very correct strategy.
However, Wind River gives up the meaning of FreeBSD and the significance of a Linux company to give up Linux is clearly different. Because FreeBSD has been in the form of a publishing business in CDROM, not like Linux, a Linux operating system itself as a main business. Even BSDI purchased CDROM, BSDI is just a commercial supplement to their BSD / OS, or they may have the wishes of FreeBSD as their main business, but they also have BSD / OS, and they purchase CDROM At the time, the IT industry is no longer, so FreeBSD is still mainly used as a publishing business.
Therefore, in relation to it as a non-main business in IT, it is not as if it returned to its own, and a company-based company is responsible for the publication and production of FreeBSD discs, which must reduce the release disc. Cost, even from commercial considerations, think BSDI, Wind River is unable to make profits from FreeBSD CD, but a professional publishing company is completely different. Currently, Daemonnews, a media company with BSD UNIX mainly assumed this task.
Therefore, Wind River waives freebsd or not, there is no great relationship with FreeBSD itself. FreeBSD does not rely on business methods, but it relies on its own strength to be recognized, and will continue to develop like this. Perhaps the affected is just the few employees who have left Wind River, however, with their qualifications, even in this short, it is not particularly difficult to find a job.