Eric's diary
by Eric rong
注:这篇文章是墨尔本大学计算机系开设的“Internet Software Development”这门课的一个作业,我把它写成了一篇日记。导师Mike说很有娱乐性,我就把它放上来吧。有兴趣的朋友可以看看。如果喜欢,可以下载到自己硬盘慢慢看。如果喜欢,可以下载到自己硬盘慢慢看。
September 22, 2004 Sunny
1
I went to Lucayan National Park, the star of the triad and the only place in the Bahamas where visitors can see all six of the island's ecosystems – collection of plants and wildlife that offers an unparalleled view into the complex interaction of native land and sea. Also within the park is one of the world’s longest underwater cave systems – a sprawling network of tunnels resulting from the island’s unique limestone geology. It was fun. And most importantly, I met a pretty girl named Helen.
2
I open my laptop and check my mailbox. There are four new received E-mails. When I saw the mail with the title “help!!!!” from John, my heart was screaming: no more work please! After thinking for a while, I still read through the mail and check it out. It turns out that John installed roundup three months ago, and it had been working properly since then, but these days it suddenly became so slow that the staffs and the customers are both complaining about the slowness. He said he didn’t know how to solve that problem, so he had to ask for my help although he understood I was enjoying my holiday and should not be interrupted.
Well, what a surprising E-mail. After reading that, the first thing came to my mind was: Wow, John installed and configured roundup!!! Anyway, I will look into that.
What is wrong?
John mentioned that a faulty product was released some days ago, so the number of complains from the customers increased dramatically. Does that relative to the slowness of the system? Maybe yes, but maybe no. The faulty product released, then the network traffic increased, and then the roundup became very slow, but this doesn’t mean the slowness in roundup was caused by the increased network traffic and the faulty product as well, although that possibility exists.
The only conclusion I can draw now is that something is wrong. To find out the question “What is wrong” needs more information. Provided it was not virus, what else might it be? Maybe he should ask Tom Cruise, because this seems like a mission impossible. With so little information, I can’t even decide on which level the problem locates. Are there any problems with the operating system? Is the application software installed compliant with each other? Are there any problems with the network infrastructures? Has he checked if it was virus? Are there any Trojans in the computer? Maybe some crackers keep hacking the machine, it is not totally impossible, but has he checked the firewall log? …He didn’t say anything about those things, how can I offer my help?
I just restored my Windows Server 2003 again using Ghost, and this is the third time I do that within three days. It was infected by I-worm virus or something, each time I was using my laptop for a while, it takes me a few minutes to move the pointer just for one inch, so I have to restore the system. This reminds me that I should update the virus definition and scan the whole computer after I finish this diary, or else I might need to restore my system the fourth time. Hey, since he is good enough to install roundup and configure it, and even make it work behind Apache for three months, why not just install it again before sending me E-mail? As you know, I never make roundup work with Apache in my laptop.
Apache?
He had Apache running as the web server. Two things that a web server continually do is sending the web content requested by the clients and executing CGI programs. When Apache is busy with sending web content to clients and the workload is highly exceeded, is it possible that the execution of CGI programs remains efficient? It’s impossible. How about using another Web Server? Will it still be the same? Is the problem located in Apache?
Roundup?
I believe many staffs must think there is something wrong with roundup, because they always find roundup is not responding. But that’s absolutely not a good way to look at things. When my computer was infected by I-worm virus, all programs run slower, so dose the program I used most often. When I run Dreamweaver, it’s not responding, so it looks like it makes everything stop. But what caused the slowness is the I-worm virus, not Dreamweaver. It is one of the victims, not the trouble maker. After I kill the I-worm virus, Dreamweaver runs as fast as usual. But that doesn’t mean Dreamweaver cause the slowness of the whole system and then it suddenly stops doing that anymore for some reasons, so the system back to normal. From the beginning till the end, Dreamweaver is innocent. There might be some problems in roundup, but there is no guarantee for that. Roundup might be that innocent Dreamweaver in my laptop.
CGI?
John seems to doubt that the problem is caused by the architectural flaws of the current system. It might be, if there are any, but I don’t see any evidence supports that conclusion. Besides, I really don’t like to criticize architecture. It is architects’ responsibility to consider all the elements at hand and even potential factors that might cause the system to work improperly, and then choose the “best” architecture for a system. It’s unfair to criticize the architecture when some problems appear. If there must be some criticism, the guy who selects the current architecture is the one who should be criticized, because it reflects the flaw of his design, not the architecture. Each coin has two sides, so is CGI. No one claims CGI program is the best way to provide web-based services under all circumstances. When it is selected, its shortcomings should have been taken into consideration already. Won’t you be surprised or disappointed to see an architect who complains about CGI just because it uses up too much memory when too many users are invoking CGI programming together? How strange it is! As if he had never thought about that before. Wouldn’t you want to ask him: excuse me, did you really ever study computer science at the university? Even if he says yes, wouldn’t you want to ask: Did you graduate?
I don’t think John had ever given a deep thought in terms of why he used the current architecture before he installed roundup. I am sure he found roundup useful, so he downloaded it. Then he realized it was written in Python, so he set up the Python running environment. Since Apache has been installed before roundup, then he looked for some documents that teach how to put Roundup behind Apache. That’s the way non-technical people do things. They won’t consider things from architectural perspectives. In fact many of them don’t even consider it necessary. John wanted to use roundup, so everything was done just for that goal. That’s normal behavior of non-technical people. But for technical engineers, he might perform some system analysis beforehand to decide which architecture should be used, with all constraints in mind. Namely, architecture comes first. John might have made a right choice to use the right architecture, exactly the same as what the technical engineers do after a thorough analysis. If so, the bottleneck is not the architecture based on the current constraint. If John had chosen the wrong architecture in the first place, nothing happens will surprise me. Furthermore, if he ever thought about architecture, why he didn’t ask some experts for opinions before he installed roundup? But if he doesn’t know anything about architectures, why only suspects the architecture? Anyway, that’s pretty amazing suspicion for a newbie.
Improvement?
Let me think about the problem of improvement. There are some alternatives to CGI, such as FastCGI, ASP, Cold Fusion, mod perl and so on. With enough money, all of them can work equally well. With constraint, it may not. Which works best depends on what constraints are. In the extreme case, with really cheap hardware, all of them work equally bad. Since John is not willing to invest any money in hardware and commercial software, so the existing hardware is the main constraint. But if the current hardware can execute CGI program really fast, to say that the bottleneck is the current architecture is unfair, even if the current architecture is not the first choice of technical engineers, because the bottleneck might be other factors. After all, the roundup has been working properly for three months. As the users increase, it is very possible that the current architecture becomes the bottleneck, because that’s one of the reasons why alternatives to CGI appear. One very important question that must be answered is that what is the maximum number of online users that will cause the performance of the current system starts to drop? Suppose that number is 1000, when the number of online users is below 1000, and the performance of the system still drops, the architecture doesn’t need to be changed at all. Since if the bottleneck is not the architecture itself, another architecture might improve the performance to certain degree, but only if the real factor or factors that cause the performance of the system decreases haven’t been found out, it remains a question if switching to another architecture will help in essence. If the bottleneck is not the architecture, no need to switch to other architecture. But if it is, maybe there should be a new design.
When considering improvement, money is always an important issue. With enough money, bottleneck could be moved to almost any places. For example, if the bottleneck is the memory, increase it; CPU, buy a better one, or use two CPU or even four; bandwidth, use fiber; computer, use two as servers… With little or even no money, little can be done. Even if John agrees to switch to J2EE, .NET or whatever, just in order to move some computation to the client side, there are still many factors need to be considered. For example, is there any freeware that work exactly the same as roundup under other architectures? If there are any, is it possible to set up the whole running environment completely for free? I highly doubt that. Furthermore, provided the server originally has that capability to serve the current clients, even the number has been increased dramatically, what if its slowness is caused by something else? Switching to other architecture is really a waste of time and money. Oh, only time, hardly forget there is no money to waste.
Solution?
John must be very anxious these days. But if I were him, I won’t simply take this as a technical problem and only look for solution from a technical expert. Technical problem doesn’t have to be solved in the technical field, and it doesn’t have to be solved by technical experts. An enterprise is composed by many departments, while technical department is only one of them. The relationship between different departments is like the relationship between different organs of the human body. When a man is suffering from headache, the syndrome doesn’t indicate there is something wrong with his head, it might be in some other places. If a famous enterprise’s products prevail all over the world, when a faulty product released, users from all around the world will go to the official website and complaint at the same time, even technical giant like Microsoft can’t prevent its website from becoming slower and even stopping providing services, let alone some company with weak technical support. Which company has billions and billions to spend? Microsoft does. Technology and money may not solve everything. Take Microsoft as an example, if it had the same syndrome as the company John works for did, where is the bottleneck? It may be the management, production, design and so on. Why only look at that from technical perspective? Why only think hardware, software and network, not sales, marketing and CRM (Customer Relationship Management)? Why only send E-mail to me not to the CEO?
If I were the CEO, in terms of this matter, I only do three things. First, make sure that the system is working as normal as last three months, no other changes should be made. This should be done as soon as possible and with the least time. If necessary, disconnect to the outside world to do that. Second, have a meeting with relative managers and come out with the best solution. Third, after-sale team should contact all the affected customers and provide the solution came out. This should be finished within a week. That’s it. The roundup should became normal very soon if these three things successfully done. After that, I will use the performance of roundup as an indicator for the health of the company I am running.
I was right, this is a mission impossible. There are too many factors that cause this roundup problem, especially when roundup is designed with the aim of ease for customization. If John is using third party databases like MySQL and so on, the problem even might be in the database. I have to stop here and tell John all about these tomorrow. As for the solution, there are many, but I don’t know which one works. You just can’t provide any workable solutions until you find out the problems. If someone can, it is really a jet pot. But lottery is not something good engineers should enjoy except for fun. I think I’d better send him a checklist so that he can go through it and check each item one by one, if the problem solved, that’s fine; if not, there is nothing else I can do before my vacation ends.
It’s really annoying to receive some jobs that you have been doing everyday for years in holidays. I hope this will never happen again. Anyway, if it comes, I’ll just throw that away.
3
The other three E-mails are from Mike, Helen and Mum. The roundup matter makes me too tired, I will only reply Helen and mum’s E-mail. As for Mike, who cares? He didn’t reply my E-mail last time anyway. Besides, I am sleepy, just want to sleep now.
4
Where should I visit tomorrow? High rock? West end? Or Deadman’s reef? I must figure it out before tomorrow.