Microsoft's improvements to PHP support and other nonsense

Source: Internet
Author: User
Here is a slide that I think is worth recommending to you. This slide is a recent speech by Microsoft Wang Chaoqun at WordCampChina2009. the speech entitled "Familiar Strangers: Microsoft's new support for PHP makes WordPress stand up on IIS7". WordCamp is a slide (download link) that I think is worth recommending to you ). This slide is a recent speech by Microsoft Wang Chaoqun at WordCamp China 2009. the speech entitled "Familiar Strangers: Microsoft's new support for PHP enables WordPress to flourish on IIS7". WordCamp is a famous PHP conference in the industry, but I recommend this slide here not to promote PHP, but to illustrate some other problems-of course there are valuable technical content, you will understand these slides and my articles.

By the way, I have already written a piece of news on InfoQ to report this incident. However, the purpose of news is to objectively describe the situation rather than posting personal opinions. However, my blog is a personal website and I plan to speak freely here.

Speaking of PHP, the famous LAMP architecture (Linux + Apache + MySQL + PHP ), this fully open platform seems to be far from the "closed" Microsoft technology. However, Microsoft has never given up its "pursuit" of PHP. this speech talks about Microsoft's efforts and achievements in this respect. One of the main reasons I recommend this slide is that it is well written, especially the first part. At the beginning of the slides, I explained Microsoft's attitude towards open source and hoped to draw closer to PHP comrades:

Well, this is the point of view: "Microsoft is no longer Microsoft in the past." It has changed. How has it become? It has become an open-source app: "open-source friends, don't look at the word" Microsoft ", so they hate it. come and hold it together ". In addition, he quoted Ray Ozzie, chief software architect of Microsoft (if I didn't identify it:

I think any company these days, any technology provider, even Microsoft, has to find the right balance of being a contributor and user of open source.

I think that any company or technology provider, even Microsoft, must find a proper balance between open-source users and contributors.

If Ray Ozzie may still be in the "White House", the words recently published by Linux founder and open-source leader Linus Torvald should be more "reference value ":

Oh, I'm a big believer in "technology over politics "... There are "extremists" in the free software world, but that's one major reason why I don't call what I do "free software" any more. I don't want to be associated with the people for whom it has s about exclusion and hatred.

Oh, I strongly think that "technology is more advanced than politics "...... There are some "geeks" in the free software world, which is also the main reason why I no longer call what I do as "free software. I don't want to be associated with people who have rejection and hate attitudes.

This statement was mentioned when someone opposed "Microsoft submitted GPL code for Linux to improve Hyper-V compatibility. The meaning of Linus is no longer clear: "technology is technology, so there is no need to know what it means ". By the way, Open Source and Free Software are very different and should not be confused. Personally, I like "open source" rather than "freedom ". I also don't like FSF. I think Microsoft is always wrong. I don't like the way it gets something. But some people certainly like it. everyone can have their own opinions.

It seems awkward. In fact, I don't know if Microsoft is just "verbal" to favor the open-source community, but I have at least seen that Microsoft is trying to prove itself-no matter whether this proves to be a trap, what are the secrets ". In this regard, Microsoft is at least setting the facts and making sense, rather than simply saying "I am embracing open source ". I think that when I was studying argumentative papers in middle school, everyone should have been informed that the basic way to be discussed was to set facts and make sense ". However, during my discussions, I thought it was not the case at all. I think that many of my friends lack the necessary logical thinking ability, which may lead to a lot of logical errors, but they still insist that they are correct. Finally, there was a quarrel. At this time, countless anonymous brothers jumped out to use their own talents, and all sorts of whimsy, which were just as if they were in the sky ", "Tianya" in the world ".

In fact, it doesn't matter if you stick to yourself correctly. I also like to stick to my opinion. who doesn't want you to be correct? However, we need to come up with a theoretical basis. In fact, as a technical practitioner, it is very simple to come up with the basis for many issues. for example, if you write a program, you will know whether generics will reduce performance. If some problems are difficult to use data to explain the problem (for example, it is difficult to obtain data), at least some people's opinions should be found to support their own views. If you blindly "I think", the "I think" effect will naturally be compromised. Therefore, I often reference myself or other people in my articles. at least I can make myself feel "confident" without being confused.

I personally dislike people who say no to practice. what I want to see is not my personal opinion, but my opinions or actual results. For example, if an anonymous friend posted a message on my blog a few days ago, he insisted that "the call of static methods will block access from other threads". I said, "If you try it, you will know ", he also copied it and sent it back to me. I don't know if he finally thinks that he has achieved the purpose of "I am misleading beginners and making advertisements for his own books" (have I ever written a book ?), At least I was helpless and angry at the time.

Now that we have talked about technology, let's talk about it a little more. The friend who believes that "the call of static methods will block access from other threads" proves that he is learning something wrong. in the Double Check article I published a few days ago, many of my friends suggested "how can I lock an instance field" and "should I lock it in a static field to produce results ". In other words, in the eyes of these friends, an instance method will not produce thread security problems-although the DefaultControllerFactory of ASP. net mvc framework has such a problem. This shows that the overall awareness of the community is still very weak in multi-threaded development-I hope this will not arouse your dissatisfaction.

In addition, yesterday I realized that many of my friends used for a long time but could not write their equivalent while statement, I also remembered that most of my colleagues in the company did not know how to include a double quotation mark in the string representation starting with @ in C. This should be the foundation of the foundation, and everyone should know, right? But the fact is that it surprised me that many of my friends think that they are constantly learning things, ASP. net mvc, Sliverlight, and WPF, but they do not know the most common things at last. As a result, my work is not good, my salary is not high, and the last crash begins to yell at the future of this industry. So have you ever thought of another way of thinking? for example, don't underestimate something at will?

Speaking of this, I think of other things, that is, I think the "ethos" in the community has encountered serious problems. For example, in more than one recent "mass incident" involving the target person, a large number of friends came forward to express dissatisfaction after someone posted an interview question, and thought it was too basic for a simple question, unable to test. For a difficult question, I think it is too difficult. I am not recruiting algorithm researchers ". In short, I found that as long as a problem cannot be answered, it will be opposed by many people. It seems that many of my friends in the community think that they are not talented. "I am here to interview you, you can't go over it." They all think that "qianma often has, but Bole doesn't often have ". A friend asked me, what do you ask during an interview? It's hard for me to talk about it, because I often ask those questions, but I was suddenly despised. In fact, nothing is simple. sometimes, asking a question is not about the result, but about the details, for example, a person's way of thinking and depth-I asked XX and xx about the difference in writing, not for "", but for other purposes. Do you believe that I will ask the other party to talk about the favorite sports rules during the interview?

Recently, I seem to have more friends who think I am bored and think that what I write has no practical significance. I think that what I write is "show off ". In fact, my articles are all based on actual work ideas. I think it is very helpful for practical work. I don't like the article "XX programming three hundred examples". I think it is "fish" rather than "fish ". I don't know what kind of articles my friends want me to write is actually meaningful, but I think the most meaningful thing is to improve your abilities, I think you should pay more attention to the problems that I think during my growth. It is not good to despise the person who despise the person, just like the person who despised the person. It doesn't matter if you despise something, but the key is, have you thought about it? Don't despise me for a long time, but I don't know what happened in the end, so I am blindly busy.

Thinking is very important. for example, a different way of thinking will produce remarkable results. At least, this is also an effective way to exercise logic. I think the best way is to write an article. If you want to understand it, you can make it clear. The same is true. if you are not clear about it, it is basically because you do not want to understand it.

I have said a lot. the more I pull, the more I drink. come back and continue.

The main topic of the PPT is naturally about Microsoft's efforts and achievements on the PHP platform. it lists the performance evaluation results of previous cooperation with Kang shengchuangxiang, it is proved that running PHP on Windows Server 2008 + IIS is significantly better than hosting Linux + Apache in terms of average response time, number of requests processed per second, and data throughput. Of course, this result is also questioned, for example, why mod_php is used in Apache rather than FastCGI with better performance in most cases. I have never tested this. I don't know, but it doesn't matter. I just want to say: Windows performance is really good.

This is also one of the PPT files. We can see that the throughput of IIS 7 can reach 20 K for static file requests and 5 k rps for ASP. NET requests (requests per second. This is 100% of the truth. I can assure you that I tried it on a common 32-bit workstation I used at Microsoft in, it is easier to request more than 10 kB of static files. Considering the performance enhancement of IIS 7 and the performance factors of the testing machine, the results are completely correct. As for the performance of ASP. NET Dynamic requests, more than 5000 is simply a meaningless number-I am not saying it is false, but I am just saying it doesn't make sense. Because for dynamic requests, there is almost no actual reference value than the throughput of such "empty requests. Because we have other performance bottlenecks and cannot meet the performance limits of IIS itself.

For common Web applications, if there is no major problem in implementation, the Web Server (IIS or machine) will hardly become a performance bottleneck. Performance bottlenecks are often caused by external server calls or external data access. For example, if there are more than one time-consuming SQL queries, the overall performance of the application will naturally fall. Therefore, the most heated discussion in the industry is often based on "caching" and various data storage methods, because so far they are most likely to become a performance bottleneck. There is no lack of discussion about the performance of the Web server itself, but there is a lot less. most of them are static request-based performance comparisons.

For websites with 2.0 of the Web, static pages cannot be generated due to too many changes, so the throughput of such Web applications on a single machine cannot reach 5 K, it is almost impossible to achieve instant access of 1 K. On a server with common configurations, if the number of dynamic requests per second is more than 100, it has basically done quite well, even more than 50 and 60 have basically "enough meaning"-5 and 600 (if I remember correctly), just like those of Douban's ghosts and gods, are almost hard to reproduce. However, 100 RPS is already an amazing number. what is the daily access volume of such a dynamic site based on 6-hour intensive requests?

Of course, Windows does not have no performance problems. I just said that there will be no performance problems in IIS and Web development. Some people say that the Windows file system, that is, NTFS, has poor performance, especially when processing fragmented files. I have heard of this, and I have similar feelings at ordinary times, but I have not gone through this practice, so I cannot come to an accurate conclusion. However, the performance is really poor, so we can try to avoid some weak links. For example, we can optimize the storage mode of our program to read continuous data as much as possible, so that the file system performance problems can be mitigated. Isn't SQL Server Building efficient data applications on NTFS?

Another problem with using the Windows system is also raised many times, namely the authorization protocol. Linux is free of money, while Windows is free of money, which should naturally be included in the cost. But in my opinion, Windows is not expensive. Why? You can go to the Dell website to check the price of a Server preinstalled with Windows Server. The price of a Web Edition Windows Server operating system is about 3000 yuan, this is equivalent to a general programmer's one-month salary. What's more, the operating system can be regarded as a one-time investment. For a company, opening a door every day is equivalent to spending tens of thousands of dollars. The price for purchasing a Web Edition Windows Server is nothing. As for the development cost, this is too "virtual" and I will not discuss it for the moment-I think there should be no reason to prove that using ASP. NET will increase the development cost.

In fact, Web Edition is enough to deploy ASP. NET applications. Enterprise Edition is more than a dozen times more expensive, but you don't need it at all. The bad habit of using pirated operating systems is "use the best if you want to use it". you must change it in the product environment. By the way, Microsoft has a very large discount or even a free strategy (such as the BizSpark program) for companies with an annual income of less than 1 million or non-profit organizations ). You should not miss it.

Therefore, I believe that using ASP. NET on Windows is a very suitable Web application development/running platform. For small entrepreneurial companies, I also choose to use Windows + ASP. NET.

But ...... Authorization prices on Microsoft platforms are not always negligible. Because SQL Server is too expensive, and the free Express version cannot be used for commercial applications. If we want to use SQL Server, the cost will indeed rise, especially for start-ups, which is more than negligible (if we join the BizSpark program ......). Therefore, Windows running ASP. NET is cheap, but SQL Server and Windows running SQL Server are expensive. Therefore, for data storage, I will choose free and open-source products under Linux. In addition, I can have more options, such as relational databases, key-value storage methods, and the no-architecture, document-type databases like MongoDB, can be properly assembled and used.

So now I am more and more recommending Windows + * nix partnerships. as for communications between Windows and * unix projects, there is no need to worry. Today, all projects use standard communication protocols (such as TCP/IP or even HTTP) to exchange data in a common or custom format. For a database in Linux, it does not care whether it is connected to Windows or Linux, or whether it is a. NET, Java, Python, or Ruby platform. You can follow the agreement.

So why does the industry always think Windows performance is poor? The reason may be that Microsoft's "reputation" is not very good, and the industry's most popular voice, most of which are open-source workers or freelancers, naturally, they will spare no effort to support their own environments-this is normal, and excellent programmers must have faith. I have always believed that-of course, some non-objective FUD behaviors will also be produced. In addition, Windows entered the server field late, and in those days of IIS 5, Windows did not perform very well in the server field. Therefore, the negative impression at that time will naturally have a negative impact. However, Microsoft is developing. There are a lot of talented people in Microsoft. the papers of Microsoft Research Institute account for a considerable proportion of major conferences every year, and the quality of Microsoft products is sufficient. If you continue to use the impression of 10 years ago to determine that Microsoft is not correct today-when Microsoft did not occupy the server (almost all Unix, Oracle ), it has occupied 80-90% of small and medium-sized companies and five hundred of the world's top 50% companies. is this not enough to explain the problem?

As a programmer on the Windows platform, we should be confident enough to let others doubt us.

By the way, another possible reason is that Microsoft's technology is too easy to get started, which makes people feel "awesome. This is not necessary, for example, if a country has a high level of primary education, can it prove that it has a high level of higher education? This is just a problem of positioning, and of course it is also Microsoft's strategy-but it is not Microsoft's fault, nor is it evidence that Microsoft technology has no value. Of course, as a programmer on the Windows platform, it is not wrong to improve your own capabilities. Not only is there no error, it must be done!

However, it must be admitted that Windows has a hard injury, that is, you cannot play things on it, such as changing a file system and changing the kernel. If you are keen on this Geek, you should naturally not use Windows.

Finally, use the content on the PPT. At the end of this PPT, there are more than 30 pages of IIS Web application configuration best practices, which is a good reference. you must take a look.

Write it here. although the end is a little hasty, I am really sleepy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.