为最佳性能调优 Nginx - 博客 - 伯乐在线
配置:
|
1
2
|
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig vim /etc/nginx/nginx.conf |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# This number should be, at maximum, the number of CPU cores on your system.# (since nginx doesn't benefit from more than one worker per CPU.)# 这里的数值不能超过 CPU 的总核数,因为在单个核上部署超过 1 个 Nginx 服务进程并不起到提高性能的作用。worker_processes 24;# Number of file descriptors used for Nginx. This is set in the OS with 'ulimit -n 200000'# or using /etc/security/limits.conf# Nginx 最大可用文件描述符数量,同时需要配置操作系统的 "ulimit -n 200000",或者在 /etc/security/limits.conf 中配置。 worker_rlimit_nofile 200000;# only log critical errors# 只记录 critical 级别的错误日志error_log /var/log/nginx/error.log crit# Determines how many clients will be served by each worker process.# (Max clients = worker_connections * worker_processes)# "Max clients" is also limited by the number of socket connections available on the system (~64k)# 配置单个 Nginx 单个进程可服务的客户端数量,(最大值客户端数 = 单进程连接数 * 进程数 )# 最大客户端数同时也受操作系统 socket 连接数的影响(最大 64K )worker_connections 4000;# essential for linux, optmized to serve many clients with each thread# Linux 关键配置,允许单个线程处理多个客户端请求。use epoll;# Accept as many connections as possible, after nginx gets notification about a new connection.# May flood worker_connections, if that option is set too low.# 允许尽可能地处理更多的连接数,如果 worker_connections 配置太低,会产生大量的无效连接请求。multi_accept on;# Caches information about open FDs, freqently accessed files.# Changing this setting, in my environment, brought performance up from 560k req/sec, to 904k req/sec.# I recommend using some varient of these options, though not the specific values listed below.# 缓存高频操作文件的FDs(文件描述符/文件句柄)# 在我的设备环境中,通过修改以下配置,性能从 560k 请求/秒 提升到 904k 请求/秒。# 我建议你对以下配置尝试不同的组合,而不是直接使用这几个数据。open_file_cache max=200000 inactive=20s;open_file_cache_valid 30s;open_file_cache_min_uses 2;open_file_cache_errors on;# Buffer log writes to speed up IO, or disable them altogether# 将日志写入高速 IO 存储设备,或者直接关闭日志。# access_log /var/log/nginx/access.log main buffer=16k;access_log off;# Sendfile copies data between one FD and other from within the kernel.# More efficient than read() + write(), since the requires transferring data to and from the user space.# 开启 sendfile 选项,使用内核的 FD 文件传输功能,这个比在用户态用 read() + write() 的方式更加高效。sendfile on;# Tcp_nopush causes nginx to attempt to send its HTTP response head in one packet,# instead of using partial frames. This is useful for prepending headers before calling sendfile,# or for throughput optimization.# 打开 tcp_nopush 选项,Nginux 允许将 HTTP 应答首部与数据内容在同一个报文中发出。# 这个选项使服务器在 sendfile 时可以提前准备 HTTP 首部,能够达到优化吞吐的效果。tcp_nopush on;# don't buffer data-sends (disable Nagle algorithm). Good for sending frequent small bursts of data in real time.# 不要缓存 data-sends (关闭 Nagle 算法),这个能够提高高频发送小数据报文的实时性。tcp_nodelay on;# Timeout for keep-alive connections. Server will close connections after this time.# 配置连接 keep-alive 超时时间,服务器将在超时之后关闭相应的连接。keepalive_timeout 30;# Number of requests a client can make over the keep-alive connection. This is set high for testing.# 单个客户端在 keep-alive 连接上可以发送的请求数量,在测试环境中,需要配置个比较大的值。keepalive_requests 100000;# allow the server to close the connection after a client stops responding. Frees up socket-associated memory.# 允许服务器在客户端停止发送应答之后关闭连接,以便释放连接相应的 socket 内存开销。reset_timedout_connection on;# send the client a "request timed out" if the body is not loaded by this time. Default 60.# 配置客户端数据请求超时时间,默认是 60 秒。client_body_timeout 10;# If the client stops reading data, free up the stale client connection after this much time. Default 60.# 客户端数据读超时配置,客户端停止读取数据,超时时间后断开相应连接,默认是 60 秒。send_timeout 2;# Compression. Reduces the amount of data that needs to be transferred over the network# 压缩参数配置,减少在网络上所传输的数据量。gzip on;gzip_min_length 10240;gzip_proxied expired no-cache no-store private auth;gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;gzip_disable "MSIE [1-6]."; |
|
1
|
vim /etc/sysctl.conf |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Increase system IP port limits to allow for more connections# 调高系统的 IP 以及端口数据限制,从可以接受更多的连接net.ipv4.ip_local_port_range = 2000 65000net.ipv4.tcp_window_scaling = 1# number of packets to keep in backlog before the kernel starts dropping them# 设置协议栈可以缓存的报文数阀值,超过阀值的报文将被内核丢弃net.ipv4.tcp_max_syn_backlog = 3240000# increase socket listen backlog# 调高 socket 侦听数阀值net.core.somaxconn = 3240000net.ipv4.tcp_max_tw_buckets = 1440000# Increase TCP buffer sizes# 调大 TCP 存储大小net.core.rmem_default = 8388608net.core.rmem_max = 16777216net.core.wmem_max = 16777216net.ipv4.tcp_rmem = 4096 87380 16777216net.ipv4.tcp_wmem = 4096 65536 16777216net.ipv4.tcp_congestion_control = cubic |
每次修订配置之后都需要执行以下命令使之生效.
|
1
|
sysctl -p /etc/sysctl.conf |
10部史上票房最高的动画片 - 电影 - 英语学习站_爱词霸

《超能陆战队》在今年的奥斯卡颁奖典礼上斩获最佳动画长片奖,该片在美国狂揽2.2亿美元票房。这个数字固然不错,但如果对照《财富》扣除通胀因素,重新发布的史上票房成绩最高的动画电影榜单,它真的不算什么。那么,史上票房最高的动画电影是哪一部呢?
Big Hero 6 was the big winner of the Academy Award for Best Animated Feature on Oscar night Sunday. The story of an inflatable personal healthcare robot with a heart of gold, it's already taken in $220 million at the domestic box office, according to Box Office Mojo, making it the 20th highest grossing animated movie of all time.
电影《超能陆战队》(Big Hero 6 )在今年的奥斯卡颁奖典礼上斩获最佳动画长片奖。据票房魔咒网统计,有一颗金子心的充气机器人大白凭借卖得一手好萌,在美国国内狂揽2.2亿美元票房,使这部影片成为有史以来票房收入第20高的动画电影。
All fine and good, but after you adjust box office totals for inflation, its haul is a lot less impressive. Fortune combed through Box Office Mojo's list of highest-grossing animated movies and adjusted their domestic totals for inflation, and some of the movies that now appear in the top 10 may be surprising. It's also worth noting that all box office totals are adjusted to 2014 dollars, because the federal Bureau of Labor Statistics, which tracks inflation, doesn't release its 2015 figures until the end of this week.
这个数字固然不错,但如果你把历年各大动画电影的票房收入用通胀率进行调整后,它就显得不那么犀利了。《财富》选取了票房魔咒网给出的史上票房成绩最高的几部动画电影,然后根据通胀率对其美国国内票房成绩进行了一番调整。扣除通胀因素后,在排在前十名的几部电影中,有几部电影的票房收入高得令人咂舌。特别要指出的是,本文所有票房数字均是基于2014年的美元币值计算而出,因为截止到上周末,联邦劳工统计局尚未发布2015年的通胀数据。
Having said that, Fortune presents a list of the highest-grossing animated movies of all time.
闲话少叙,请看《财富》为您奉献的史上最高票房收入动画电影排行榜。
10. Toy Story 2
《玩具总动员2》
The 1999 sequel to 1995's critically and commercially acclaimed Toy Story, this second installment finds Buzz Lightyear and the gang trying to rescue their pal Woody from the clutches of a remorseless toy dealer.
由于1995年推出的首部《玩具总动员》(Toy Story)叫好又叫座,制片方于1999年拍摄了该电影的续集。在本片中,巴斯光年和他的朋友们试图从一个冷酷的玩具商手中营救出他们的朋友胡迪。
While the first movie had won accolades from critics and audiences alike, the sequel was a huge step forward in terms of story and characterization, and raised the bar for what a children's movie could do. It took in $246 million as the 20th Century wrapped up, for a total of $350 million after inflation.
《玩具总动员1》获得了影评人和观众的一致赞誉,《玩具总动员2》则在历史和角色刻画上都向前迈了一大步,为以后的儿童电影树立了更高的标杆。该片出品方20世纪公司狂揽2.46亿美元,经通胀调整后约为3.5亿美元。

9. Shrek
《怪物史莱克》
In 2001, a hideous ogre with a Scottish accent voiced by Mike Meyers made his big-screen debut. Children everywhere were delighted, and the flagship effort in a highly profitable franchise was born.
2001年,一只由迈克•麦耶斯配音,操苏格兰口音的搞笑怪兽登上大银幕,并一下子征服了全球各地的小朋友。一个利润丰富的商业主题就此诞生。
Full of tongue-in-cheek references to other films, it kept mom and dad amused while junior reveled in the glorious fart humor. It raked in $268 million at the domestic box office, or $358 million today.
由于片中时常出现对其它电影的恶搞桥段,该片在吸引儿童的同时,也让陪同看片的父母们忍俊不禁。该片当时的美国票房为2.68亿美元,折合现在的3.58亿美元。
8. Shrek the Third
《怪物史莱克3》
By 2007, the Shrek franchise had already proven itself a highly profitable commodity, making a third trip back to the well mandatory. Featuring the voices of Monty Python alumni John Cleese and Eric Idle, as well as that of radio host Larry King as Doris the Ugly Stepsister, the third installment did even better than the original, with domestic box office receipts of $323 million, or $369 million today.
到2007年,史莱克早已成为一块金字招牌,其第三部电影也就顺理成章地上映了。除了电台主持人拉里•金为“丑陋的继姐”配音外,英国知名喜剧团体Monty Python成员约翰•克里斯和埃里克•爱都也为本片倾情献声。该片的反响甚至超过了第一部,美国国内票房收入达到3.23亿美元,折合现在的3.69亿美元。

7. Despicable Me 2
《卑鄙的我2》
Released in 2010, the original Despicable Me took in $252 million. Naturally, this meant that there had to be a sequel, which was delivered to salivating children in the summer of 2013.
2010年上映的《卑鄙的我》(Despicable Me )获得了2.52亿美元的票房成绩。如此佳绩当然意味着必然要拍续集。2013年夏天,《卑鄙的我2》终于火爆上映。
Adorable tykes across this great nation returned to the multiplexes to delight in the antics of Gru (Steve Carell) and the Minions, who could be seen gracing pajamas, cookies and other merchandise everywhere you looked. The movie earned $368 million, or $374 million in today’s dollars, and was also nominated for a Best Animated Feature Oscar. It lost, but the filmmakers could console themselves by crying into a pillow made of money.
全美的小朋友再次进入电影院,欣赏格鲁(由史蒂夫•卡莱尔配音)和小黄人们的滑稽搞笑。穿着背带裤的小黄人继续各种卖萌耍宝。该片获得3.68亿美元票房,折合现在的3.74亿美元。《卑鄙的我2》也被提名为当年的奥斯卡最佳动漫长片奖,虽然最后未能成功抱得奥斯卡小金人,但当制片方流下伤感的泪水时,他们至少可以抱着赚来的一大堆美金擦擦眼角。
6. Monsters, Inc.
《怪兽公司》
Monsters, Inc. is the story of two creatures that help power their hometown of Monstropolis with the screams of the children they scare. It features the voices of John Goodman, Billy Crystal and Steve Buscemi, and is the rare children’s film that parents could actually enjoy along with their kids.
《怪兽公司》(Monsters, Inc)讲述了在一个靠小孩子恐惧的尖叫声提供能源的怪兽世界里,两只小怪兽如何成为怪兽公司头牌恐吓者的故事。本片的配音演员有约翰•古德曼、比利•克里斯托和史蒂夫•布西密等,它也是少数父母可以与孩子共同享受观影乐趣的儿童片之一。
It opened to huge box office totals in November 2001, with only the first Harry Potter and Lord of the Ringsmovies able to knock it off its lofty perch. It earned $290 million in its theatrical run, or $388 million in today's dollars.
该片在2001年11月一经上映就获得巨额票房,当时只有《哈利波特》(Harry Potter )第一部和《指环王》(Lord of the Ring)系列电影能把它拉下票房榜首宝座。该片的票房收入达到2.9亿美元,约合现在的3.88亿美元。
5. Frozen
《冰雪奇缘》
If you are the parent of a girl under age 10 or so, then you do not need the plot of 2013's Frozen encapsulated for you. The musical fantasy, which raked in $400 million ($406 million today), is the subject of maniacal fandom, and your daughter – or maybe even your son – has probably been more than happy to talk your ear off about it since its release.
如果你有一个十岁以下的女儿,那你完全不必担心没看过《冰雪奇缘》(Frozen )。这部狂揽4亿美元(折合现在的4.06亿)的音乐幻想片是孩子们的狂热话题。自从这部片子上映以来,你的女儿,甚至你的儿子可能早已不厌其烦地向你描绘了多次片中的情节。
Frozen reached its box office total through repeat viewings, and it spawned sing-along events at theaters that became the kiddie equivalent of The Rocky Horror Picture Show. The plethora of Frozen-themed birthday parties and little girls dressed up as Princess Elsa at Halloween should be a big hint to parents that their children are not about to "let it go" any time soon.
《冰雪奇缘》不仅吸引了许多儿童反复观看,而且它还衍生了一批以此为主题的音乐剧,后者就相当于是孩子们的《洛基恐怖秀》。各地冒出的一大堆《冰雪奇缘》主题生日会,以及万圣节上无数扮演埃尔莎公主的小女孩,充分说明了“冰雪热”短时间内难以消退,父母们还是“随它吧”。

4. Toy Story 3
《玩具总动员3 》
Coming 11 years after Toy Story 2, moviegoers could have been forgiven for wondering what more the franchise could possibly have to say. However, critics and moviegoers alike were stunned to find that the third installment was in fact the best of the series, and it took in $415 million, the equivalent of $451 million today.
在《玩具总动员2》播出11年后,很多观影者可能好奇《玩具》系列是否还有进一步挖掘的空间。不过等《玩具3》上映后,观影者和影评人惊奇地发现,第三部其实是整个系列中水准最高的一部。该片获得了4.15亿美元的票房收入,约合今天的4.51亿美元。
Like Big Hero 6, it won the Academy Award for Best Animated Feature. Also like Big Hero 6, there may have been more than a few parents in the theater who did not expect it to be as tearful as it was. Despite the movie ending on a note that seemed to rule out another sequel, a fourth installment is currently scheduled for 2017.
像《超能陆战队》一样,该片也获得了奥斯卡最佳动画长片奖。另外很多父母没有想到,这部片子最后也像《超能陆战队》一样有泪点。尽管在片子末尾的彩蛋处表明制片方可能会再次推出续集,但目前看来,第四部《玩具总动员》可能要到2017年才会推出。
3. Finding Nemo
《海底总动员》
Finding Nemo is like Bambi, in that it belongs to the long, proud tradition of Disney films in which the main character's mother gets killed, thereby necessitating years of therapy for the little children who saw it.
和《小鹿斑比》(Bambi)一样,《海底总动员》(Finding Nemo)的故事情节也沿用了迪斯尼多年来屡试不爽的桥段:主角的母亲惨死后,目睹这一幕的孩子需要多年的心理建设才能恢复过来。
The story of a lost clownfish from the Great Barrier Reef, the 2003 film took in $380 million at the domestic box office, or $489 million after inflation. It was the highest-grossing G-rated film ever made until Toy Story 3conquered it with its unadjusted box office gross.
本片讲述了一只小丑鱼在大堡礁被抓走,小丑鱼的父亲为爱寻子的冒险历程。这部2003年的电影获得了3.8亿美元的国内票房,约合现在的4.89亿美元。在《玩具总动员3》上映之前,它一直是美国电影史上票房最高的G级片,直至前者凭借未经通胀调整的票房收入打破了它的纪录。
2. Shrek 2
《怪物史莱克2》
Shrek 2 was released in 2004 and followed the adventures of the unsightly ogre and his newly betrothed wife Fiona. It parodies such well-known children's stories as The Wizard of Oz and The Little Mermaid, and also introduced Puss in Boots, a swashbuckling Mexican cat voiced by Antonio Banderas.
《怪物史莱克2》上映于2004年,它继续讲述了史莱克与妻子费欧娜的冒险故事。片中也恶搞了《绿野仙踪》和《小美人鱼》等知名童话故事。同时本片还加入了一个新角色——由安东尼奥•班德拉斯配音的墨西哥“靴子猫”。
The most popular film in the entire franchise, it earned $441 million at the domestic box office, the equivalent of a staggering $553 million today. A fourth film, Shrek Forever After, was released in 2010, but the status of a much hinted-at fifth film remains shrouded in mystery.
作为《怪兽史莱克》系列中最受欢迎的一部,该片在美国获得了4.41亿美元的票房收入,约合现在的5.53亿美元。该系列的第四部也于2010年推出,但目前还不知道第五部的制作进展情况。

1. The Lion King
《狮子王》
It should come as no surprise that The Lion King is the highest-grossing animated film of all time. A stone cold classic beloved by children for over 20 years – and maybe a few of their parents too – the 1994 movie inspired three video games and a musical now in its 18th year on Broadway.
史上票房最高的动画电影被《狮子王》(The Lion King )摘得,应该是名至实归的,谁也不会感到意外。这部里程碑式的经典大片被孩子们深深热爱了20多年,当年最早的一批辛巴小粉丝如今也为人父母了。这部摄制于1994年的电影已经被改编成三种视频游戏和一部音乐剧,后者已经在百老汇上演了18年。
The movie's domestic box office take of $423 million is impressive even before it's adjusted for inflation, at which point it reaches a Titanic-esque $676 million. It leaves every other animated movie on this list in its dust, with the cruel and unrelenting force of a wildebeest stampede.
该片的票房收入高达4.23亿美元,即便不用通胀率进行调整,这个数额也是相当惊人了,而在用通胀率调整后,它的票房数字折合现在的6.76亿美元,达到了《泰坦尼克号》(Titanic)的高度,像非洲大草原上迁徙的角马一样,无情地将其它所有上榜电影甩在了它扬起的尘埃里。
