Chapter 89: The Optimization of HTTPd
Di Ye did not go to the R&D group in the afternoon, not because he wanted to go out and carouse, but because he needed to look at code himself.
Yuncheng is located inland and is isolated from information; before Di Ye disappeared, the software he used and the code he read were very limited, which led to Xiao Honghua not having a rich grasp of 1990s programming knowledge, and the programs it wrote always had one error or another, so it needs to catch up on lessons now.
Fortunately, Xiao Honghua has a strong ability to receive and analyze information; as long as it does not report errors, Di Ye treats himself as a human camera, just needing to glance at the computer screen, and if it does report an error, he then stops to examine it carefully.
After tossing about in such a cursory manner for an entire afternoon, Di Ye looked at the source code of over 100 pieces of software in total, only stopping when dusk fell and he was famished.
In order to test the effect of reading the code, before going out to eat, Di Ye packed his personal belongings while asking Xiao Honghua to rewrite HTTPd using C Language.
"Do you need to refer to Nginx?"
"No need. Nginx can be brought out later when there is a need to solve the C10K problem. For now, just optimize HTTPd to make it more stable and easier to use."
Nginx is a lightweight Web server software that only appeared in 2004; its performance is better than Apache and it is more popular in the market, but Di Ye does not want to bring it out for the time being because websites in 1995 are very rudimentary, there are not many netizens, and the C10K problem will not be encountered; the original version of HTTPd is already sufficient.
C10K refers to the problem of a single machine handling 10,000 concurrent connections simultaneously. Since servers in the 90s were all based on process/thread models, for every TCP connection, one process or thread needed to be allocated. If 10,000 clients connected at the same time, 10,000 would need to be created, which would occupy a large amount of hardware resources and cause the Operating Systems to crash.
This problem is very important in the 21st century, but it is not important in 1995 because web pages are all static. Even for a star-level website like Yahoo, there are only one or two hundred users online at the same time, so there is no need to consider this problem for now.
Furthermore, if all the good things that are too advanced are brought out, the market might not appreciate it.
Di Ye has had profound lessons in this regard. When he wrote those Open Source articles back then, he used great enthusiasm and zeal to discuss many commercially viable business models for the future, but the result was being mocked and ridiculed; it was not even as effective as a single sentence of "show your code," so he has now changed his strategy to win through micro-innovation.
"Master, it has been written."
Xiao Honghua's progress is obvious; it only took a few seconds to rewrite HTTPd. This time, not only were there no errors, but it also thoughtfully created a PPT document comparing the optimized version with the original, proving that stability, ease of use, and performance are all-around superior.
Di Ye was very satisfied with this result and decided to type out the optimized version that night, so after finishing his meal in the hotel restaurant, he took a taxi to the R&D group.
Because various functional modules in the early days of the internet were relatively simple, the source code for HTTPd and the Mosic Browser was not very large. Di Ye explained while typing on the keyboard, finishing in just over 3 hours, which once again drove the team members collectively crazy.
"Boss Hua, are you trying to make it impossible for us to live? We just barely understood the original version!"
"Understanding the original version is fine; in the future, this web server software will depend on you all to maintain it. Come, come, come, give it a name."
Naming software is the only project the R&D group currently has a sense of participation in, so their enthusiasm was high; after discussions and voting, they finally named this optimized version of HTTPd "Flying Cloud," pairing it with Speed Dragon, because clouds follow dragons and winds follow tigers.
"Should Flying Cloud be uploaded to the Speed Dragon official website or the Little Red Flower official website?"
"Upload it to the Speed Dragon website first, and then transfer it to Xiao Honghua after a while."
Di Ye stood up, handed the computer's control to Su Zhaonian, and said, "Now that you have both the Operating Systems and the web server software, you can build a few websites or BBS to practice and test it out."
"Boss Hua, we are still missing an Open Source database software."
"There is postgre on the disc numbered 5; that is the database software, but it is a bit complicated to use. Study it in your spare time; you will need it later."
After Di Ye gave his guidance, he walked to the balcony and made a phone call to Professor Luo at Hong Kong Polytechnic University to inquire about the download status of several software programs on the Xiao Honghua official website—because there is no Javascript, the download volume cannot be displayed on the web page and can only be seen from the server side.
"Today, the download volume for both DY-ZIP and WebP exceeded 500. I asked the students, and they all think they are good, especially WebP, which is particularly convenient to use."
"Okay, thank you, Professor Luo."
There are 3 pieces of software on the Xiao Honghua Open Source Foundation official website: one is DY-ZIP, which Di Ye wrote earliest; one is Oleander, which Di Ye wrote before going to Hong Kong; and another is a piece of software that Di Ye finished writing during the winter vacation but had not yet released, called WebP Image Viewer.
On the fourth day of the Lunar New Year, Di Ye carried a case of Moutai to pay a New Year's visit to Liu Shaosong, which aroused Fu Chuanyi's curiosity. Afterward, he found notes with words like "JPEG" and "GIF" written on them in the study; it was at that time that Di Ye had already started tinkering with WebP.
WebP is an Open Source image format released by Google in 2010. It supports both lossy and lossless compression as well as dynamic images, and has the advantages of a high compression ratio and support for transparent channels. Di Ye used this as a foundation to specifically write an image viewer that can convert formats like JPEG and GIF into WebP, intending to use it as a bargaining chip to attempt cooperation with Netscape.
The popularity of JPEG and GIF on the internet is all thanks to Netscape. Mosic was the first browser to support JPEG images, and Netscape 2.0 was the first browser to support GIF images. While providing support, it also conveniently added the crucial repeat-playback function to GIF images, making it an instant hit, and it remains active on the internet in the form of memes even in 2023.
However, both of these image formats required fees in 1995.
The patent for JPEG is in the hands of a company called Forgent Networks. During the entire validity period of the patent, this company sued more than 60 internet companies and over 30 PC manufacturers, collecting more than 100 million US dollars in patent fees.
The patent for GIF is in the hands of two companies, Unisys and CompuServe. They charged even more ruthlessly, with even non-commercial websites and private websites having to pay licensing fees of over 5,000 US dollars.
Because the fleecing was too severe, netizens suffered greatly and even launched campaigns to boycott it. In order to replace GIF, W3C created an MNG format in 1996, but unfortunately, the MNG encoding was written too poorly, leading browser manufacturers to be unwilling to support it, and it eventually fizzled out, leaving only a lossless compression image format, PNG, as a legacy.
Since Netscape is the source of the internet bubble in the late 90s, Di Ye does not intend to compete with it in browser technology for the time being, so as not to strike too hard and affect the grand occasion when it goes public. Therefore, he plans to use a content format like WebP to try and cooperate with Netscape; after all, his goal is to unify web technology standards, not to kill Netscape.
If the WebP cooperation is successful, he will continue to promote the next content format, such as music. Regarding music formats, Di Ye planned even earlier and had discussed it with Shi Yucheng before the Spring Festival, but he has not yet found the right time to bring it out.
"Di Ye, have you written a reply to that American company yet?"
"Not yet, I'm going to write it now."
End of Chapter
