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

Rumah pangkalan data tutorial mysql Twilio incident and Redis

Twilio incident and Redis

Jun 07, 2016 pm 04:35 PM
and redis twilio

Twilio just released a post mortem about an incident that caused issues with the billing system: http://www.twilio.com/blog/2013/07/billing-incident-post-mortem.html The problem was about a Redis server, since Twilio is using Redis to stor

Twilio just released a post mortem about an incident that caused issues with the billing system:

http://www.twilio.com/blog/2013/07/billing-incident-post-mortem.html

The problem was about a Redis server, since Twilio is using Redis to store the in-flight account balances, in a master-slaves setup, with multiple slaves in different data centers for obvious availability and data safety concerns.

This is a short analysis of the incident, what Twilio can do and what Redis can do to avoid this kind of issues.

The first observation is that Twilio uses Redis, an in memory system, in order to save balances, so everybody will say "WTF Twilio! Are you serious with your data?". Actually Redis uses memory to serve data and to internally manipulate its data structures, but the incident has *nothing to do* with the durability of Redis as a DB. In fact Twilio stated that they are using the append only file that can be a very durable solution as explained here: http://oldblog.antirez.com/post/redis-persistence-demystified.html

The incident is actually centered around two main aspects of Redis:

1) The replication system.
2) The configuration.

I'll address they two things respectively.

Analysis of the replication issue
===

Redis 2.6 always needs a full resynchronization between a master and a slave after a connection issue between the two.
Redis 2.8 addressed this problem, but is currently a release candidate, so Twilio had no way to use the new feature called "partial resynchronization".

Apparently the master became unavailable because many slaves tried to resynchronize at the same time.

Actually for the way Redis works a single slave or multiple slaves trying to resynchronize should not make a huge difference, since just a single RDB is created. As soon as the second slave attaches and there is already a background save in progress in order to create the first RDB (used for the bulk data transfer), it is put in a queue with the previous slave, and so forth for all the other slaves attaching. Redis will just produce a single RDB file.

However what is true is that Redis may use additional memory with many slaves attaching at the same time, since there are multiple output buffers to "record" to transfer when the RDB file is ready. This is true especially in the case of replication over WAN. In the Twilio blog post I read "multiple data centers" so it is possible that the replication process may be slow in some case.

The bottom line is, Redis normally does not need to go slow when multiple slaves are resynchronizing at the same time, unless something strange happens like hitting the memory limit of the server, with the master starting to swap and/or problems with very slow disks (probably EC2?) so that creating an RDB starts to mess with the ability to write to the AOF file.

However issues writing to the AOF are a bit unlikely to be the cause, since during the AOF rewrite there is the same kind of disk i/o stress, with one thread writing a lot of data to the new AOF, and the other (main) thread logging every new write to the AOF. Everything considered memory pressure seems more probable, but Twilio engineers can just comment with details about what happened, this will be an useful real-world data point for sure.

From the Twilio side, what is possible to do to minimize incidents, is to understand exactly why the master is not able, with the current architecture, to survive without serious loss of performance to many slaves resynchronizing.

From the Redis side, well, we had to do our homework and provide partial resynchronization *long time ago* probably, we finally have it in Redis 2.8, and it is very good that a few days ago I pushed forward the 2.8 release skipping all the other pending features for this release that will be postponed for the next release. Now we have the first release candidate, in a few weeks this should be a release in the hands of users.

The configuration
===

The other obvious problem, probably the biggest one, was restarting the master with the wrong configuration.

Again I think here there was an human error that was "helped" by a Redis non perfect mechanism.

Basically up to Redis 2.6 you had CONFIG SET to change the configuration by hand, so it was possible for example to switch the system from RDB to AOF for more data safety with just:

redis-cli CONFIG SET appendonly yes

However you had to change the configuration file manually in order to ensure that the change will affect the instance after the next restart. Otherwise the change is only in the current in memory configuration and a restart will bring you back to the old config.

Maybe this was not the case, but it is not unlikely that Twilio engineers modified the wrong redis.conf file or forgot to do it in some way.

Fortunately Redis 2.8 provides a better workflow for on-the-fly configuration changes, that is:

redis-cli CONFIG SET appendonly yes
redis-cli CONFIG REWRITE

Basically the config rewriting feature will make sure to change the currently used configuration file, in order to contain the configuration changes operated by CONFIG SET, which is definitely safer.

In the end
===

I'll be happy to work with the Twilio engineers in the next weeks in order to understand the details and their requests and see how Redis can be improved to make incidents like this less likely to happen.

A real world test
===

I just tried to setup a master with AOF enabled, rotating disks, and a huge write load. Only trick is, it is bare metal entry-level hardware.

Then I put a steady load on it of 70k writes per second across 10 millions of keys.

Finally I tried to mass-resync four slaves form scratch multiple times.

Results:

$ redis-cli -h 192.168.1.10 --latency-history
min: 0, max: 26, avg: 0.97 (1254 samples) -- 15.00 seconds range
min: 0, max: 5, avg: 0.66 (1287 samples) -- 15.00 seconds range
min: 0, max: 2, avg: 0.62 (1290 samples) -- 15.00 seconds range
min: 0, max: 1, avg: 0.47 (1307 samples) -- 15.01 seconds range
min: 0, max: 10, avg: 0.48 (1306 samples) -- 15.00 seconds range
min: 0, max: 1, avg: 0.47 (1310 samples) -- 15.01 seconds range
min: 0, max: 3, avg: 0.45 (1311 samples) -- 15.01 seconds range
min: 0, max: 10, avg: 0.48 (1305 samples) -- 15.01 seconds range
min: 0, max: 23, avg: 0.49 (1306 samples) -- 15.01 seconds range
min: 0, max: 3, avg: 0.47 (1307 samples) -- 15.01 seconds range
min: 0, max: 36, avg: 0.86 (1255 samples) -- 15.00 seconds range
min: 0, max: 6, avg: 1.05 (1246 samples) -- 15.01 seconds range
min: 0, max: 21, avg: 0.52 (619 samples)^C

As you can see there is no moment in which the server struggles with this load. During the test the load continued to be accepted at the rate of 70k writes/sec.

This test is in no way able to simulate the Twilio architecture, but the bottom line here is, Redis is supposed to handle this well with minimally capable hardware so something odd happened, or there was a low memory condition, or there was the "EC2 effect", that is, some very poor disk performance allowed for memory pressure. Comments
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn

Alat AI Hot

Undress AI Tool

Undress AI Tool

Gambar buka pakaian secara percuma

Undresser.AI Undress

Undresser.AI Undress

Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover

AI Clothes Remover

Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Clothoff.io

Clothoff.io

Penyingkiran pakaian AI

Video Face Swap

Video Face Swap

Tukar muka dalam mana-mana video dengan mudah menggunakan alat tukar muka AI percuma kami!

Alat panas

Notepad++7.3.1

Notepad++7.3.1

Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina

SublimeText3 versi Cina

Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1

Hantar Studio 13.0.1

Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6

Dreamweaver CS6

Alat pembangunan web visual

SublimeText3 versi Mac

SublimeText3 versi Mac

Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Topik panas

Tutorial PHP
1502
276
Pek pengembangan terbaik Laravel yang disyorkan: 2024 Alat penting Pek pengembangan terbaik Laravel yang disyorkan: 2024 Alat penting Apr 30, 2025 pm 02:18 PM

Pakej lanjutan Laravel yang penting untuk 2024 termasuk: 1 Laraveldebrugbar, yang digunakan untuk memantau dan debug kod; 2. Laraveltelescope, menyediakan pemantauan aplikasi terperinci; 3. Laravelhorizon, menguruskan tugas -tugas redis. Pek pengembangan ini dapat meningkatkan kecekapan pembangunan dan prestasi aplikasi.

Pembinaan Persekitaran Laravel dan Konfigurasi Asas (Windows/Mac/Linux) Pembinaan Persekitaran Laravel dan Konfigurasi Asas (Windows/Mac/Linux) Apr 30, 2025 pm 02:27 PM

Langkah -langkah untuk membina persekitaran Laravel pada sistem operasi yang berbeza adalah seperti berikut: 1.Windows: Gunakan XAMPP untuk memasang PHP dan komposer, konfigurasikan pembolehubah persekitaran, dan pasang Laravel. 2.MAC: Gunakan homebrew untuk memasang PHP dan komposer dan pasang Laravel. 3.Linux: Gunakan Ubuntu untuk mengemas kini sistem, pasang PHP dan komposer, dan pasang Laravel. Perintah dan laluan khusus setiap sistem adalah berbeza, tetapi langkah -langkah teras adalah konsisten untuk memastikan pembinaan lancar persekitaran pembangunan Laravel.

Redis: perbandingan dengan pelayan pangkalan data tradisional Redis: perbandingan dengan pelayan pangkalan data tradisional May 07, 2025 am 12:09 AM

Redis lebih tinggi daripada pangkalan data tradisional dalam senario latency yang tinggi dan rendah, tetapi tidak sesuai untuk pertanyaan kompleks dan pemprosesan transaksi. 1.Redis menggunakan penyimpanan memori, bacaan cepat dan tulis kelajuan, sesuai untuk kesesuaian tinggi dan keperluan latensi yang rendah. 2. Pangkalan data tradisional didasarkan pada cakera, sokongan pertanyaan kompleks dan pemprosesan transaksi, dan mempunyai konsistensi dan ketekunan data yang kuat. 3. Redis sesuai sebagai suplemen atau pengganti pangkalan data tradisional, tetapi ia perlu dipilih mengikut keperluan perniagaan tertentu.

Bagaimana untuk mengehadkan sumber pengguna di Linux? Bagaimana cara mengkonfigurasi ULIMIT? Bagaimana untuk mengehadkan sumber pengguna di Linux? Bagaimana cara mengkonfigurasi ULIMIT? May 29, 2025 pm 11:09 PM

Sistem Linux mengehadkan sumber pengguna melalui perintah ULIMIT untuk mengelakkan penggunaan sumber yang berlebihan. 1.Ulimit adalah arahan shell terbina dalam yang boleh mengehadkan bilangan deskriptor fail (-N), saiz memori (-V), kiraan thread (-u), dan lain-lain, yang dibahagikan kepada had lembut (nilai berkesan semasa) dan had keras (had atas maksimum). 2. Gunakan perintah ULIMIT secara langsung untuk pengubahsuaian sementara, seperti ULIMIT-N2048, tetapi hanya sah untuk sesi semasa. 3. Untuk kesan tetap, anda perlu mengubah suai /etc/security/limits.conf dan fail konfigurasi PAM, dan tambah sessionrequiredpam_limits.so. 4. Perkhidmatan SystemD perlu menetapkan LIM dalam fail unit

Adakah Redis terutamanya pangkalan data? Adakah Redis terutamanya pangkalan data? May 05, 2025 am 12:07 AM

Redis terutamanya pangkalan data, tetapi ia lebih daripada sekadar pangkalan data. 1. Sebagai pangkalan data, Redis menyokong kegigihan dan sesuai untuk keperluan berprestasi tinggi. 2. Sebagai cache, Redis meningkatkan kelajuan tindak balas aplikasi. 3. Sebagai broker mesej, REDIS menyokong mod penerbitan-langganan, sesuai untuk komunikasi masa nyata.

Redis: Beyond SQL - Perspektif NoSQL Redis: Beyond SQL - Perspektif NoSQL May 08, 2025 am 12:25 AM

Redis melampaui pangkalan data SQL kerana prestasi dan fleksibiliti yang tinggi. 1) Redis mencapai bacaan dan tulis kelajuan yang sangat cepat melalui penyimpanan memori. 2) Ia menyokong pelbagai struktur data, seperti senarai dan koleksi, sesuai untuk pemprosesan data yang kompleks. 3) Model tunggal-threaded memudahkan pembangunan, tetapi konkurensi tinggi mungkin menjadi kesesakan.

Langkah dan Contoh untuk Membangun Laman Web PHP Dinamik Dengan PHPStudy Langkah dan Contoh untuk Membangun Laman Web PHP Dinamik Dengan PHPStudy May 16, 2025 pm 07:54 PM

Langkah -langkah untuk membina laman web PHP yang dinamik menggunakan PHPStudy termasuk: 1. Pasang PHPStudy dan mulakan perkhidmatan; 2. Konfigurasi Direktori Root Laman Web dan Sambungan Pangkalan Data; 3. Tulis skrip PHP untuk menghasilkan kandungan dinamik; 4. Debug dan mengoptimumkan prestasi laman web. Melalui langkah -langkah ini, anda boleh membina laman web PHP dinamik yang berfungsi sepenuhnya dari awal.

Redis: Membentangkan tujuan dan aplikasi utama Redis: Membentangkan tujuan dan aplikasi utama May 03, 2025 am 12:11 AM

Redisisanopen-Source, In-MenoryDataStructureStoreusedasadatabase, Cache, andMessageBroker, ExcellingInspeedandversatility.Iswidelyededforcaching, Real-Timeanalytics, sessionManagement, danSleaderboardsDuetoitssupportorvariousdatastructures

See all articles