Coblog is a place recording all the trifles of my life.
关于 firefox 里面和 HTTP 连接有关的参数设置
关于 firefox 里面和 HTTP 连接有关的参数设置
本文是我和一个大牛啰里啰唆的聊天记录整理翻译,属于科普,有些地方可能说得不准确,大家不要当作专业技术文章看。欢迎拍砖。
一个典型的网页,是由一个 html 文件和内嵌的各类元素组成的,这些元素包括页面内的图片,css 文件,javascript 文件等等。每一个内嵌的元素在 HTTP 协议的层面上和那个 html 文件是没有区别的:也就是都需要浏览器去服务器上抓下来。一个早期典型的浏览器是这样实现的:当用户敲入网址之后,浏览器和服务器建立连接,请求这个 html 页面,然后边接收服务器发送的 html 页面,边解析,碰到内嵌元素,可以立即开第二条连接请求。另外,如果内嵌元素很多,他可能会开多条连接同时请求。当所有需要的元素都下载完毕之后,浏览器就会将页面画出来。这个过程就是最早期的 HTTP/1.0 协议所设想的浏览器实现。
HTTP/1.0 这种多连接的运作模式是可以改进的。建立 TCP 连接的过程是这样:客户端给服务器发一个网络包说我要和你建立连接,服务器收到之后回一个网络包说"我愿意",然后客户端要再发给服务器一个网络包说"好那咱们开始传数据吧"。这一来一去三个包才能建立 TCP 连接。连接建立之后,浏览器给服务器发请求,服务器给浏览器回应。完事之后又要来回几个网络包关闭 TCP 连接。如果页面有很多文件长度很短的元素,每个元素都需要单建一条连接就会导致网络上大量的都是 TCP 建立连接和断开连接的网络包。另外,TCP 有一个特性叫做 slow start,其含义可以大致这样解释:TCP 连接要求发送端发送一定数量的网络包之后接收端就要回一个"我收到"的网络包,而且网络包在经过每个路由器的时候包头都要被重写,所以在网络不丢包的情况下网络包越大网络的效率就越高。TCP 连接寻找最优网络包大小的方法是,在 TCP 连接建立的初期,网络包的大小是很小的,根据网络状况,两端的程序才会逐步增大网络包的大小以适应带宽提高网络传输的效率。所以浏览器给服务器发请求,如果每发一个请求就关闭连接的话,那这个连接的数据传输很难达到带宽所能承载的速度。
基于这种种原因,HTTP/1.1 很快出来了,提出了持久连接(persistent connection)的概念,也就是说同一条 HTTP 连接,可以同时处理多个请求,同时用一定的机制保证各个请求之间的分离性。具体的操作过程是:服务器给浏览器发送回应之后,并不马上关闭连接;浏览器判断上一个请求的回应已经收完的情况下,可以在这同一个连接上发第二个请求。这种运作模式大大减少了网络包,实验也表明这种做法很有效。但是,由于服务器上保持连接要占用一定的资源,所以一般服务器不会永久保持持久连接,而且也不推荐浏览器和服务器之间建立过多的持久连接。
持久连接可以进一步提速。这就是 pipelining 了。上面可以看到,浏览器需要等待持久连接里上一个请求的回应完全收完才能发送后面的请求。如果和服务器的连接比较慢,往往持久连接大部分时间都花在等待而非数据发送/接收上。pipelining 的意思是,浏览器可以在一个持久连接里一次给服务器发送多个请求,服务器在这个连接上依次回应这些请求。这种运作方式和浏览器缓存结合起来的时候会尤其有效果。比方,图片浏览过后会存在浏览器缓存中,再次请求的时候浏览器会对服务器说,我这里已经有这个图片的缓存了,修改时间是XXXX,如果服务器上这个图片在这之后没有修改过,就不用重发了。这种情况下,服务器会发一个很短的 304 Not Modified 类型的回应。如果没有 pipelining,每次这样问一下都要等待网络上传输打一个来回;而如果有 pipelining,浏览器可以同时问服务器我这里 4 个图片是否有修改,如果服务器对 pipelining 支持的好,它甚至可以将四个回应放到同一个网络包里面传回来,这是一个大大的加速。
pipelining 最早提出的时候还有一种设想的用法是,如果服务器对 pipelining 支持的好,可以把同一个 pipeline 里面的两个请求放到两个 CPU 上去处理,这样能进一步加快响应速度。当然这个可能也没什么用。
好咯,回过来看一下 firefox about:config network.http.* 的相关参数
network.http.keep-alive 默认是 true
是否允许持久连接,这个默认就是 true,改成 false 的是大傻瓜。
network.http.keep-alive.timeout 默认是 300
持久连接允许的保持时间,这个调大了没意义,因为一般 server 设置的就是 300。server 把你咔嚓了你还能有什么办法。
network.http.max-connections-per-server 默认是 8
连接同一个服务器允许的最大连接数,一般认为在开启持久连接的情况下把这个数值调大没什么作用,而且不太道德。需要调大的情况比方:你同时从网站下 10 个大文件。
network.http.max-persistent-connections-per-server 默认是 2
连接同一个服务器允许的最大持久连接数,这个数值 HTTP/1.1 标准推荐的是 2。调大了反而增加你自己的网络消耗,而且一般一个服务器允许的持久连接数是有限的,你调大了就可能造成别人可用的减少,如果大家都调大,就意味着网络效率的丧失。我个人建议不要动这个数值。
network.http.pipelining 默认是 false
是否允许 pipelining,这个功能因为目前还是试验阶段,所以默认没有打开。强烈建议打开。
network.http.pipelining.maxrequests 默认是 4
每个持久连接允许一次发送的请求数。如果 pipeline 里面有一个大图片或者执行时间较长的脚本,后面已经发送的请求就会被阻塞(注意服务器必须是依次回应请求);而在这种情况下,如果没有使用 pipelining,浏览器发现一个请求处理时间很长,自然会使用另一条持久连接用作后续请求,甚至进一步开启非持久连接。另外,如果服务器支持pipelining 不好而过早的关闭连接,浏览器势必要重新发送请求。基于这种种原因,有人认为这个数字设置得比 2 大反而会降低浏览速度。我个人的推荐是,这个数值一般情况可以保持默认值 4,如果浏览的网站有大量的静态小图片,或者网络速度较慢,可以尝试将其调大。
network.http.max-persistent-connections-per-proxy 默认是 4
每个代理服务器允许的最大持久连接数。4 是目前比较公认的最合适的数值,尽管HTTP/1.1 的推荐值是 2。
network.http.proxy.keep-alive 默认是 true
连接代理服务器是否允许持久连接。true 挺好的。
network.http.proxy.pipelining 默认是 false
连接代理服务器是否允许 pipelining。目前普遍认为大多数代理服务器支持 pipelining并不好,所以一般不建议打开。
pipelining 目前是一个有争议的,仍旧在实验阶段的特性。虽然它可能确实会加快浏览速度,但是这在一定程度上取决于网络的各项因素,所以不要盲目的按照网上建议的方式设置相关的参数。
Betaloc
How does this medication work? What will it do for me?
Metoprolol is a beta-blocker that is used to treat high blood pressure and prevent the symptoms of angina (chest pain). It works by reducing the demands put on the heart. Metoprolol is also taken by people who have had a heart attack to reduce the risk of having another one. When used for the reduction of blood pressure, additional blood pressure-lowering medications may be used along with metoprolol.
Your doctor may choose to use a medication for conditions other than the ones listed in these drug information articles. If you're unsure why you are taking this medication, contact your doctor.
How should I use this medication?
The recommended dose of metoprolol ranges from 100 mg daily to 400 mg daily. Immediate-release tablets are taken in two divided doses while slow-release tablets are taken once a day. The medication may be taken with or without food. The usual starting dose for treatment of high blood pressure and angina pectoris is 50 mg twice daily. The doctor may increase the dose if the desired results have not been achieved within one week. Once the best dose has been found with the immediate-release tablets, the slow-release tablets may be substituted at an equal daily dose for convenience.
Many things can affect the dose of medication that a person needs, such as body weight, other medical conditions, and other medications. If your doctor has recommended a dose different from the ones listed here, do not change the way that you are taking the medication without consulting your doctor.
It is very important to take this medication regularly, exactly as prescribed by your doctor. If you miss a dose, take it as soon as possible and continue on with your regular schedule. If it is almost time for your next dose, skip the missed dose and continue on with your regular dosing schedule. Do not double doses.
Do not stop taking this medication suddenly without checking with your doctor first. Stopping the medication suddenly after you have been taking it for a while may cause unpleasant and potentially harmful effects.
What form(s) does this medication come in?
Betaloc® is available in tablet, long-acting (durules) and injectable (I.V. or intravenous) forms.
Betaloc® Tablets
50 mg: Each white, scored, circular tablet, engraved "A" over "BB", contains metoprolol 50 mg.
100 mg: Each white, scored, circular tablet, engraved "A" over "ME", contains metoprolol 100 mg.
Nonmedicinal ingredients: colloidal silica, lactose, magnesium stearate, microcrystalline cellulose, polyvinyl pyrrolidone, and sodium starch glycolate. These tablets do not contain gluten or tartrazine.
Betaloc® Durules: Each white, rod-shaped film-coated tablet, engraved "A" over "MD", contains metoprolol 200 mg. Nonmedicinal ingredients include aluminum silicate, ethylcellulose, hydroxypropyl methylcellulose, magnesium stearate, paraffin, polyethylene glycol, and titanium dioxide. This medication does not contain gluten, lactose, or tartrazine.
Betaloc® I.V.: Each mL of aqueous injectable solution contains metoprolol 1 mg and sodium chloride 9 mg. This meidcation comes in glass vials of 5 mL.
Who should NOT take this medication?
Metoprolol should not be taken by anyone who:
What side effects are possible with this medication?
The side effects listed below are not experienced by everyone who takes this medication. If you are concerned about side effects, discuss the risk and benefits of this medication with your doctor. Your health professional may be able to help you to deal with some of the effects.
The following side effects may go away as your body becomes used to the medicine; check with your doctor if they continue to become bothersome:
More common
Less common or rare
Contact your doctor as soon as possible if any of the following side effects occur:
Less common
Rare
Some people may experience side effects other than those listed. Check with your doctor if you notice any symptom that worries you while you are taking this medication.
Are there any other precautions or warnings for this medication?
Breathing conditions: Patients with asthma and certain other breathing problems should, in general, not receive a beta-blocker such as metoprolol. Low doses of metoprolol may be used with caution in patients with asthma who do not respond to, or who cannot tolerate, alternative treatment.
Diabetes: The signs of low blood sugar may not be as noticeable when taking metoprolol. People with diabetes who take insulin or other drugs that work by reducing the insulin in the blood should be cautious and monitor blood sugar carefully while taking this medication.
History of heart failure: People with a history of heart failure should be cautious while taking this medication as it may increase the risks associated with this condition.
Hyperthyroidism (high level of thyroid hormones): People with hyperthyroidism should be cautious while taking metoprolol as it may reduce the symptoms of this condition giving a false impression of improvement. Stopping the medication suddenly could worsen this condition.
Liver disease: People with liver disease should be cautious when taking this medication.
Occupational hazards: Use of metoprolol may cause dizziness, fatigue, or a slower reaction time while driving or operating heavy machinery. Use appropriate caution.
Severe allergies: People with allergies severe enough to cause anaphylaxis (a severe allergic reaction where swelling of the face, lips, and throat make it difficult to breathe) should talk to their doctor about what to do if they have an allergic reaction. Metoprolol may make it more difficult to treat their allergic reaction with epinephrine.
Stopping usage: Metoprolol should not be stopped suddenly by people who are taking it to treat angina. There have been reports of severe worsening of angina, and of heart attack or abnormal heart rhythms occurring in people with angina pectoris who have done this.
Surgery: If you are scheduled for surgery, inform all doctors involved in your care that you are taking metoprolol.
Pregnancy: Metoprolol should not be taken by pregnant women. Its use by women of childbearing age requires that the anticipated benefit be cautiously weighed against possible risks.
Breast-feeding: Metoprolol appears in breast milk in very small quantities. Nursing mothers should exercise caution if taking this medication.
Children: The safety and effectiveness of metoprolol for use by children have not been established.
What other drugs could interact with this medication?
The following medications may affect the way that metoprolol works or increase the risk of side effects:
Metoprolol may affect how the following medications work:
If you are taking any medications containing this drug, speak with your doctor or pharmacist. Depending on your specific circumstances, your doctor may want you to:
An interaction between two medications does not always mean that you must stop taking one of them. In many cases, interactions are intended or are managed by close monitoring. Speak to your doctor about how any drug interactions are being managed or should be managed.
Medications other than those listed above may interact with this medication. Tell your doctor or prescriber about all prescription, over-the-counter (non-prescription) and herbal medications that you are taking. Also tell them about any supplements you take. Since caffeine, alcohol, the nicotine from cigarettes, or illegal drugs can affect the action of many medications, you should let your prescriber know if you use them.
Betaloc
How does it work?
What is it used for?
Use with caution in
Not to be used in
Side effects
How can this medicine affect other medicines?
| Betaloc | ||
| Main Use | Active Ingredient | Manufacturer |
| High blood pressure, Angina | Metoprolol Tartrate. | AstraZeneca |
| How does it work? Metoprolol belongs to a group of medicines called beta-blockers, which block beta receptors in the heart, lungs and other organs of the body. Blocking these receptors prevents the action of two chemicals called noradrenaline and adrenaline that occur naturally in the body. These are often referred to as the 'fight or flight' chemicals as they are responsible for the body's reaction to stressful situations. Blocking the beta receptors in the heart causes the heart to beat more slowly and with less force. The heart therefore uses less energy and the pain of angina is prevented. Abnormal heart rhythms are also prevented. Due to the heart beating more slowly and with less force, the pressure at which blood is pumped out of the heart to the rest of the body is reduced. This is just one of the ways in which beta blockers help to reduce blood pressure, however the whole mechanism is not fully understood. Metoprolol is used to decrease symptoms such as rapid heart rate, sweating and tremor which are associated with thyrotoxicosis. It is also used to prevent migraine, although it is not fully understood how metoprolol works in this area. What is it used for?
If you feel you have experienced an allergic reaction, stop using this medicine and inform your doctor or pharmacist immediately. Pregnancy and Breastfeeding Certain medicines should not be used during pregnancy or breastfeeding. However, other medicines may be safely used in pregnancy or breastfeeding providing the benefits to the mother outweigh the risks to the unborn baby. Always inform your doctor if you are pregnant or planning a pregnancy, before using any medicine.
Medicines and their possible side effects can affect individual people in different ways. The following are some of the side effects that are known to be associated with this medicine. Because a side effect is stated here, it does not mean that all people using this medicine will experience that or any side effect.
For more information about any other possible risks associated with this medicine, please read the information provided with the medicine or consult your doctor or pharmacist. How can this medicine affect other medicines? When taken with other medicines that decrease blood pressure there is an increased risk of a large drop in blood pressure. There may be an increased risk of slow heart rate when metoprolol is taken with digoxin. In diabetic people, metoprolol can prolong the lowering of blood sugar (hypoglycaemia) caused by insulin or other antidiabetic medicines. Individuals should monitor their blood sugar, as metoprolol can also mask the signs of hypoglycaemia. When metoprolol is taken with calcium channel blockers such as verapamil, the risk of slow heart rate, hypotension and heart failure may be increased. Verapamil should be avoided with this medicine. If metoprolol is taken together with clonidine, there is a risk of a rebound increase in blood pressure if clonidine is stopped. Metoprolol should be stopped several days before slowly stopping the clonidine. Non-steroidal anti-inflammatory drugs (NSAIDs) such as indomethacin may reduce the antihypertensive effects of metoprolol. Care should be taken when adrenaline is given with metoprolol as this combination can cause severely high blood pressure and slow heart rate. Rifampicin increases the removal of this medicine from the body. The use of certain anaesthetics with metoprolol may increase the risk of low blood pressure and slow heart rate. When lignocaine is taken together with metoprolol the blood level of lignocaine may be increased. Anti-arrhythmic medicines such as amiodarone or dipyridamole may increase the risk of slow heart rate when taken with this medicine. Other medicines containing the same active ingredients
|
Listen to This 2, Lesson 1, Section 1
Listen to This 2, Lesson 1, Section 1
Section One:
Vocabulary:
compere/monitor/lane/brilliant/baseball/classics/fabulous/marathon/hang out/salon
Exercises:
Task 1: This Is Your Life!
1. Choose the best answer (a, b or c) to complete each of the following statements.
(1) "This Is Your Life" is __________.
a. the most popular programme on British and American television
b. one of the most popular programmes on British and American radio
c. one of the most popular programmes on British and American television
(2) "This Is Your Life" is a ___________ programme.
a. weekly
b. monthly
c. daily
(3) The programme is recorded in _________.
a. studio 4
b. studio 3
c. studio 2
(4) The programme begins at _________.
a. 6:45
b. 7:55
c. 8:00
(5) The subject of tonight's show will be ___________.
a. Terry Donovan
b. Jason Douglas
c. Pauline
(6) Camera ________ will be at the studio entrance.
a. four
b. three
c. two
2. True or False Questions. (T/F)
(7) The person invited to "This Is Your Life" does not know that he or she will be the subject of the programme.
(8) The subject can meet only friends and relatives from his or her past at the studio.
(9) Terry Donovan is the compère only for tonight's show.
(10) Jason Douglas will arrive at the studio at eight sharp.
(11) Jason will be sitting in the middle for most of the show.
(12) Usually the guests wait in Room 401 and Pauline tells them when they should enter.
3. Identification. Match each name in Column I with a description in Column II to identify the person.
Column I
(1) Jason Douglas
(2) Terry Donovan
(3) Pauline
(4) Susan Fraser
(5) Stanley Hooper
(6) Maria Montrose
(7) Charles Orson
Column II
(a) Jason's English teacher
(b) the subject of tonight's programme
(c) an actress who worked with Jason in 1974
(d) the compère
(e) a director
(f) the person who waits with the guests in Room 401
(g) Jason's sister
Answer: (1)—; (2)—; (3)—; (4)—; (5)—; (6)—; (7)—.
4. Complete the following résumé for Jason Douglas.
Name: Jason Douglas
Former name:
Profession:
Date of birth:
1952: started school
1958: _____
1966: _____
1969: _____
1973: _____
1974: _____ with Maria Montrose
http://user.hjenglish.com/cet/james999/L2TH01-1.mp3
Working with Resources in Palm OS Applications
By Alex Gusev
Constant | Value | Description |
| strRsc | 'tSTR' | String resource |
| ainRsc | 'tAIN' | Application Icon Name resource |
| iconType | 'tAIB' | Icon resource |
| bitmapRsc | 'Tbmp' | Bitmap resource |
| bsBitmapRsc | 'Tbsb' | Boot screen bitmap. This resource is system reserved |
| alertRscType | 'Talt' | Alert resource |
| kbdRscType | 'tkbd' | Keyboard resource. This resource is system reserved |
| MenuRscType | 'MBAR' | Menu Bar resource |
| fontRscType | 'NFNT' | Single density Font resource |
| fontExtRscType | 'nfnt' | High density Font resource |
| verRsc | 'tver' | Version resource |
| appInfoStringsRsc | 'tAIS' | Application Categories are store here. This resource can be passed to the CategoryInitialize() API |
| fontIndexType | 'fnti' | Represents the font index. This resource is system reserved |
| midiRsc | 'MIDI' | Palm MIDI compliant resource |
| colorTableRsc | 'tclt' | UI Color Table resource |
| constantRscType | 'tint' | Integer constant resource. ResLoadConstant() API can be called to load the this type of resource |
| formRscType | 'tFRM' | UI Form resource |
| strListRscType | 'tSTL' | This is a string list resource |
| wrdListRscType | 'wrdl' | List of WORD (2 bytes) values |
| defaultCategoryRscType | 'taic' | Launcher Category ID. Your application will be placed under the appropriate category on the Palm device |
| binaryGeneralRscType | 'tbin' | General binary resource. You may store any raw data here |
Constant | Value | Description |
| strRsc | 'tSTR' | String resource |
| ainRsc | 'tAIN' | Application Icon Name resource |
| iconType | 'tAIB' | Icon resource |
| bitmapRsc | 'Tbmp' | Bitmap resource |
| bsBitmapRsc | 'Tbsb' | Boot screen bitmap. This resource is system reserved |
| alertRscType | 'Talt' | Alert resource |
| kbdRscType | 'tkbd' | Keyboard resource. This resource is system reserved |
| MenuRscType | 'MBAR' | Menu Bar resource |
| fontRscType | 'NFNT' | Single density Font resource |
| fontExtRscType | 'nfnt' | High density Font resource |
| verRsc | 'tver' | Version resource |
| appInfoStringsRsc | 'tAIS' | Application Categories are store here. This resource can be passed to the CategoryInitialize() API |
| fontIndexType | 'fnti' | Represents the font index. This resource is system reserved |
| midiRsc | 'MIDI' | Palm MIDI compliant resource |
| colorTableRsc | 'tclt' | UI Color Table resource |
| constantRscType | 'tint' | Integer constant resource. ResLoadConstant() API can be called to load the this type of resource |
| formRscType | 'tFRM' | UI Form resource |
| strListRscType | 'tSTL' | This is a string list resource |
| wrdListRscType | 'wrdl' | List of WORD (2 bytes) values |
| defaultCategoryRscType | 'taic' | Launcher Category ID. Your application will be placed under the appropriate category on the Palm device |
| binaryGeneralRscType | 'tbin' | General binary resource. You may store any raw data here |