国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

首頁 資料庫 mysql教程 Redis latency spikes and the 99th percentile

Redis latency spikes and the 99th percentile

Jun 07, 2016 pm 04:40 PM
and redis the

One interesting thing about the Stripe blog post about Redis is that they included latency graphs obtained during their tests. In order to persist on disk Redis requires to call the fork() system call. Usually forking using physical server

One interesting thing about the Stripe blog post about Redis is that they included latency graphs obtained during their tests. In order to persist on disk Redis requires to call the fork() system call. Usually forking using physical servers, and most hypervisors, is fast even with big processes. However Xen is slow to fork, so with certain EC2 instance types (and other virtual servers providers as well), it is possible to have serious latency spikes every time the parent process forks in order to persist on disk. The Stripe graph is pretty clear in this regard.

img://antirez.com/misc/stripe-latency.png

As you can guess, if you perform a latency test during the fork, all the requests crossing the moment the parent process forks will be delayed up to one second (taking as example the graph above, not sure about what was the process size nor the EC2 instance). This will produce a number of samples with high latency, and will affect the 99th percentile result.

To change instance type, configuration, setup, or whatever in order to improve this behavior is a good idea, and there are use cases where even a single request having a too high latency is unacceptable. However apparently it is not obvious how latency spikes of 1 second every 30 minutes (or more, if you use AOF with the right rewrite triggers) is very different from latency spikes which are evenly distributed in the set of requests.

With evenly distributed spikes, if the generation of a page needs to perform a number of requests to a Redis server in order to create the output, it is very likely that a page view will incur in the latency penalty: this impacts the quality of service in a great way potentially, check this link: http://latencytipoftheday.blogspot.it/2014/06/latencytipoftheday-most-page-loads.html.

However 1 second of latency every 30 minutes run is a completely different thing. For once, the percentile with good latency gets better *as the number of requests increase*, since the more the requests are, the more this second of latency will be unlikely to get over-represented in the samples (if you have just 1 request per minute, and one of those requests happen to hit the high latency, it will affect the 99.99th percentile much more than what happens with 100 requests per second).

Second: most page views will be unaffected. The only users that will see the 1 second delay are the ones that make a request crossing the fork call. All the other requests will experience an extremely low probability of hitting a request that has a latency which is significantly worse than the average latency. Also note that a page view crossing the fork time, even when composed of 100 requests, can’t be delayed for more than a second, since the requests are completed as soon as the fork() call terminates.

The bottom line here is that, if there are hard latency requirements for each single request, it is clear that a setup where a request can be delayed 1 second from time to time is a big problem. However when the goal is to provide a good quality of service, the distribution of the latency spikes have a huge effect on the outcome. Redis latency spikes due to fork on Xen are isolated points in the line of time, so they affect a percentage of page views, even when the page views are composed of a big number of Redis requests, which is proportional to the latency spike total time percentage, which is, 1 second every 1800 seconds in this case, so only the 0.05% of the page views will be affected.

Latency characteristics are hard to capture with a single metric: the full percentile curve and the distribution of the spikes, can provide a better picture. In general good rule of thumbs are a good way to start a research, and in general it is true that the average latency is a poor metric. However to promote a rule of thumb into an absolute truth has also its disadvantages, since many complex things remain complex, and in need for close inspection, regardless of our willingness to over simplify them.

At the same time, fork delays in EC2 instances are one of the worst experiences for Redis users in one of the most popular runtime environments today, so I’m starting to test Redis with EC2 regularly now: we’ll soon have EC2 specific optimization pages on the Redis official documentation, and a way to operate master-slaves replicas with persistence disabled in a safer way.

If you need EC2 + Redis master with persistence disabled now, the simplest to deploy “quick fix” is to disable automatic restarts of Redis instances, and use Sentinel for failover, so that crashed masters will not automatically return available, and will be failed over by Sentinel. The system administrator can restart the master manually after checking that the failover was successful and there is a new active master.

EDIT: Make sure to check the Hacker News thread that contains interesting information about EC2, Xen and fork time: https://news.ycombinator.com/item?id=8532851. Also not all the EC2 instances are the same, and certain types provide great fork time on pair with bare metal systems: https://redislabs.com/blog/testing-fork-time-on-awsxen-infrastructure#.VFJQ-JPF8yF Comments
本網(wǎng)站聲明
本文內(nèi)容由網(wǎng)友自願投稿,版權(quán)歸原作者所有。本站不承擔(dān)相應(yīng)的法律責(zé)任。如發(fā)現(xiàn)涉嫌抄襲或侵權(quán)的內(nèi)容,請聯(lián)絡(luò)admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費(fèi)脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅(qū)動的應(yīng)用程序,用於創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費(fèi)的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費(fèi)的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強(qiáng)大的PHP整合開發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺化網(wǎng)頁開發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Laravel 教程
1600
29
PHP教程
1502
276
Laravel 最佳擴(kuò)展包推薦:2024 年必備工具 Laravel 最佳擴(kuò)展包推薦:2024 年必備工具 Apr 30, 2025 pm 02:18 PM

2024年必備的Laravel擴(kuò)展包包括:1.LaravelDebugbar,用於監(jiān)控和調(diào)試代碼;2.LaravelTelescope,提供詳細(xì)的應(yīng)用監(jiān)控;3.LaravelHorizon,管理Redis隊列任務(wù)。這些擴(kuò)展包能提升開發(fā)效率和應(yīng)用性能。

Laravel 環(huán)境搭建與基礎(chǔ)配置(Windows/Mac/Linux) Laravel 環(huán)境搭建與基礎(chǔ)配置(Windows/Mac/Linux) Apr 30, 2025 pm 02:27 PM

在不同操作系統(tǒng)上搭建Laravel環(huán)境的步驟如下:1.Windows:使用XAMPP安裝PHP和Composer,配置環(huán)境變量,安裝Laravel。 2.Mac:使用Homebrew安裝PHP和Composer,安裝Laravel。 3.Linux:使用Ubuntu更新系統(tǒng),安裝PHP和Composer,安裝Laravel。每個系統(tǒng)的具體命令和路徑有所不同,但核心步驟一致,確保順利搭建Laravel開發(fā)環(huán)境。

REDIS:與傳統(tǒng)數(shù)據(jù)庫服務(wù)器的比較 REDIS:與傳統(tǒng)數(shù)據(jù)庫服務(wù)器的比較 May 07, 2025 am 12:09 AM

Redis在高並發(fā)和低延遲場景下優(yōu)於傳統(tǒng)數(shù)據(jù)庫,但不適合複雜查詢和事務(wù)處理。 1.Redis使用內(nèi)存存儲,讀寫速度快,適合高並發(fā)和低延遲需求。 2.傳統(tǒng)數(shù)據(jù)庫基於磁盤,支持複雜查詢和事務(wù)處理,數(shù)據(jù)一致性和持久性強(qiáng)。 3.Redis適用於作為傳統(tǒng)數(shù)據(jù)庫的補(bǔ)充或替代,但需根據(jù)具體業(yè)務(wù)需求選擇。

linux如何限制用戶資源? ulimit怎麼配置? linux如何限制用戶資源? ulimit怎麼配置? May 29, 2025 pm 11:09 PM

Linux系統(tǒng)通過ulimit命令限制用戶資源,防止資源過度佔(zhàn)用。 1.ulimit是shell內(nèi)置命令,可限製文件描述符數(shù)(-n)、內(nèi)存大?。?v)、線程數(shù)(-u)等,分為軟限制(當(dāng)前生效值)和硬限制(最高上限)。 2.臨時修改直接使用ulimit命令,如ulimit-n2048,但僅對當(dāng)前會話有效。 3.永久生效需修改/etc/security/limits.conf及PAM配置文件,並添加sessionrequiredpam_limits.so。 4.systemd服務(wù)需在unit文件中設(shè)置Lim

Redis主要是數(shù)據(jù)庫嗎? Redis主要是數(shù)據(jù)庫嗎? May 05, 2025 am 12:07 AM

Redis主要是一個數(shù)據(jù)庫,但它不僅僅是數(shù)據(jù)庫。 1.作為數(shù)據(jù)庫,Redis支持持久化,適合高性能需求。 2.作為緩存,Redis提升應(yīng)用響應(yīng)速度。 3.作為消息代理,Redis支持發(fā)布-訂閱模式,適用於實(shí)時通信。

REDIS:超越SQL- NOSQL的觀點(diǎn) REDIS:超越SQL- NOSQL的觀點(diǎn) May 08, 2025 am 12:25 AM

Redis超越SQL數(shù)據(jù)庫的原因在於其高性能和靈活性。 1)Redis通過內(nèi)存存儲實(shí)現(xiàn)極快的讀寫速度。 2)它支持多種數(shù)據(jù)結(jié)構(gòu),如列表和集合,適用於復(fù)雜數(shù)據(jù)處理。 3)單線程模型簡化開發(fā),但高並發(fā)時可能成瓶頸。

REDIS:揭示其目的和關(guān)鍵應(yīng)用程序 REDIS:揭示其目的和關(guān)鍵應(yīng)用程序 May 03, 2025 am 12:11 AM

Redisisanopen-Source,內(nèi)存內(nèi)部的庫雷斯塔氏菌,卡赫和梅斯吉級,excellingInsPeedAndVersatory.itiswidelysusedforcaching,Real-Timeanalytics,Session Management,Session Managements,and sessighterboarderboarderboardobboardotoitsssupportfortfortfortfortfortfortfortfortorvortfortfortfortfortfortforvortfortforvortforvortforvortfortforvortforvortforvortforvortdatastherctuct anddatataCcessandcessanddataaCces

用PhpStudy搭建動態(tài)PHP網(wǎng)站的步驟與示例 用PhpStudy搭建動態(tài)PHP網(wǎng)站的步驟與示例 May 16, 2025 pm 07:54 PM

使用PhpStudy搭建動態(tài)PHP網(wǎng)站的步驟包括:1.安裝PhpStudy並啟動服務(wù);2.配置網(wǎng)站根目錄和數(shù)據(jù)庫連接;3.編寫PHP腳本生成動態(tài)內(nèi)容;4.調(diào)試和優(yōu)化網(wǎng)站性能。通過這些步驟,你可以從零開始搭建一個功能完整的動態(tài)PHP網(wǎng)站。

See all articles