freecodecamp_freeCodeCamp的服务器到底发生了什么?
freecodecamp
Update at 17:00 California time: We have now fixed most of the problems. We're still working on a few known issues, but /learn is now fully operational.
加利福尼亞時間17:00更新 :我們現(xiàn)在解決了大多數(shù)問題。 我們?nèi)栽谔幚硪恍┮阎獑栴},但是/ learn現(xiàn)在可以完全使用。
Here was the culprit - a regular expression-based query that was running against millions of database records every time a someone tried to authenticate.
罪魁禍?zhǔn)资且粋€基于正則表達(dá)式的查詢,每次有人嘗試進(jìn)行身份驗證時,該查詢都會針對數(shù)百萬個數(shù)據(jù)庫記錄運行。
And here's our cluster's CPU usage before and after we fixed the problem:
這是修復(fù)問題前后我們?nèi)杭腃PU使用率:
This may seem obvious, but it took Mrugesh 3 days of detective work to identify the bottleneck.
這看起來似乎很明顯,但是Mrugesh花費了 3天的偵探工作來確定瓶頸。
We've concluded that we could have spotted this earlier with a $30 per month tool, so we broke down and bought it for future usage.
我們得出的結(jié)論是,我們可以使用每月30美元的工具早些時候發(fā)現(xiàn)它,因此我們拋售了它,以備將來使用。
What follows is a more in-depth explanation of what happened.
接下來是對發(fā)生的事情的更深入的解釋。
簡而言之: (In short:)
- On Tuesday we rolled out a ton of new code. Including code that allow us to continuously deliver new features and bug fixes. 在星期二,我們推出了許多新代碼。 包括允許我們不斷提供新功能和錯誤修復(fù)的代碼。
- We thought we'd load-tested our new code enough. But it wasn't high-performance enough for the sudden weight of 2,000 concurrent users. 我們認(rèn)為我們已經(jīng)對新代碼進(jìn)行了足夠的負(fù)載測試。 但是對于2000個并發(fā)用戶的突然增加,它的性能還不夠。
- /forum and /news worked fine, but the sign-in functionality on /learn was unreliable for 3 days. / forum和/ news可以正常工作,但是/ learn上的登錄功能在3天內(nèi)不可靠。
好。 現(xiàn)在更多細(xì)節(jié)。 (OK. Now some more detail.)
For the past 10 months or so, we've been accumulating new features, bug fixes, and curriculum improvements.
在過去的10個月左右,我們一直在積累新功能,錯誤修復(fù)和課程改進(jìn)。
We've continued to merge improvements into our Master branch and deploy them to our beta server at www.freecodecamp.dev.
我們繼續(xù)將改進(jìn)合并到我們的Master分支中,并將其部署到我們的beta服務(wù)器,網(wǎng)址為www.freecodecamp.dev。
For the past 2 months, lots of contributors have people using this beta version of freeCodeCamp.
在過去的兩個月中,許多貢獻(xiàn)者都在使用此版本的freeCodeCamp的人們。
And in celebration of freeCodeCamp's 5th anniversary this month, we wanted to go ahead and push all of these improvements into production at www.freecodecamp.org.
為了慶祝本月freeCodeCamp成立5周年,我們希望繼續(xù)前進(jìn),并在www.freecodecamp.org上將所有這些改進(jìn)投入生產(chǎn)。
On Tuesday, we went down for what we thought would be 3 minutes of planned maintenance. We did a final testing run, took a database backup, sent out a "we'll be right back" tweet, and pushed 10 months worth of code live all at once.
在星期二,我們進(jìn)行了3分鐘的計劃維護(hù)。 我們進(jìn)行了最后的測試,備份了數(shù)據(jù)庫,發(fā)出了一條“我們馬上回來”的推文,并一次發(fā)布了10個月的代碼。
But Murphy's Law was waiting behind the corner to club us in the knees. And as more and more traffic piled on, our servers buckled.
但是墨菲定律在拐角處等著我們。 隨著越來越多的流量堆積,我們的服務(wù)器崩潰了。
We were able to get /forum and /news back up almost immediately. But /learn required authentication, and hit some additional API endpoints and servers. So for 3 days we scrambled to get it to work.
我們幾乎可以立即獲得/ forum和/ news的備份。 但是/ learn需要身份驗證,并需要使用其他一些API端點和服務(wù)器。 因此,我們花了3天時間努力使它正常工作。
It turned out our new code wasn't as high-performance as we'd thought, and we were hitting our API servers a lot more than necessary.
事實證明,我們的新代碼不如我們想像的那樣具有高性能,并且我們對API服務(wù)器的攻擊遠(yuǎn)遠(yuǎn)超出了必要。
So we identified parts of the codebase that were making unnecessary API calls and refactored them, while also juggling DevOps challenges.
因此,我們確定了代碼庫中進(jìn)行不必要的API調(diào)用的部分并對其進(jìn)行了重構(gòu),同時還應(yīng)對了DevOps的挑戰(zhàn)。
為什么會這樣呢? 真? (Why did this happen, though? Really?)
At the end of the day, this outage was my fault.
歸根結(jié)底,這次故障是我的錯。
Here's why.
這就是為什么。
Our total budget for 2019 is only about $300,000. And yet we're helping millions of people learn to code every month.
我們2019年的總預(yù)算僅為300,000美元。 但是,我們每個月都在幫助數(shù)百萬人學(xué)習(xí)編碼。
We now get more traffic than other learn-to-code sites like Udacity and Codecademy. We get even more traffic than mainstream news websites like TechCrunch.
現(xiàn)在,與Udacity和Codecademy等其他學(xué)習(xí)型代碼站點相比,我們獲得的流量更多。 我們獲得的流量甚至超過TechCrunch等主流新聞網(wǎng)站。
When you operate at such extreme scale with such a paltry budget, you end up clipping coupons.
當(dāng)您以如此微不足道的預(yù)算在如此極端的規(guī)模上運作時,您最終會得到優(yōu)惠券。
Those giant servers that could give you comfortable overhead for spikes? Too expensive.
那些巨大的服務(wù)器可以為您帶來峰值的開銷? 太貴了。
Those fancy DevOps services that identify choke points? Too expensive.
那些可以識別阻塞點的高級DevOps服務(wù)? 太貴了
Our team of 5 engineers ends up doing the work of 10.
我們由5名工程師組成的團(tuán)隊最終完成了10名工作。
My point is - it's my fault freeCodeCamp only has $300,000 to work with this year. To put that number perspective, I know individual developers in San Francisco whose salary is larger than $300,000.
我的意思是-這是我的錯freeCodeCamp今年只有30萬美元可以使用。 從數(shù)字角度來看,我知道舊金山的個人開發(fā)人員的薪水超過300,000美元。
There's nothing wrong with having a big salary. San Francisco is an expensive city.
高薪?jīng)]有錯。 舊金山是一個昂貴的城市。
But there is a problem when freeCodeCamp - one of the largest education sites on the internet - is trying to operate on such a comically tiny budget.
但是當(dāng)freeCodeCamp(互聯(lián)網(wǎng)上最大的教育網(wǎng)站之一)試圖以如此可笑的小預(yù)算運作時,就會出現(xiàn)問題。
Again, it's my fault.
再次,這是我的錯。
I'm inexperienced at grassroots fundraising.
我對基層籌款沒有經(jīng)驗。
I'm still learning how to raise awareness of all the work we're doing for the community.
我仍在學(xué)習(xí)如何提高對我們?yōu)樯鐓^(qū)所做的所有工作的認(rèn)識。
I am shy when it comes to asking you all to donate money to fund that work.
當(dāng)我要求大家捐款以資助這項工作時,我很害羞。
So I am going to make a concerted effort to get better, and to increase our budget.
因此,我將共同努力以求更好,并增加我們的預(yù)算。
I don't want to run ads.
我不想投放廣告。
I don't want to say "freeCodeCamp, brought to you by the Acme Corporation."
我不想說“由Acme Corporation帶給您的freeCodeCamp”。
And of course, I don't ever want to charge learners for our learning resources.
當(dāng)然,我絕對不想向?qū)W習(xí)者收取我們的學(xué)習(xí)資源。
So far, we haven't had to do any of these things.
到目前為止,我們還沒有做任何這些事情。
But this really only leaves us with one source for funding. We, the people.
但這實際上只給我們提供了一種資金來源。 我們?nèi)祟悺?
freeCodeCamp is a grass-roots donor-supported nonprofit. We just need to get better at asking people for money.
freeCodeCamp是由基層捐助者支持的非營利組織。 我們只需要變得更好就可以向人們索要錢。
We are heading into the holiday season. This is when about 80% of the year's charitable gifts are made here in the US.
我們即將進(jìn)入假期。 這是當(dāng)年大約80%的慈善禮物是在美國制造的。
So I'm going to stay focused on this. I will document what I learn as I experiment. And I will eventually create a fundraising handbook for other grass-roots donor-supported nonprofits based on what I learn.
所以我將繼續(xù)專注于此。 我將記錄我在實驗中學(xué)到的東西。 最后,我將根據(jù)我所學(xué)的知識,為其他基層捐助者支持的非營利組織編寫籌款手冊。
This is a bit embarrassing, but our current donate page is down today because our authentication is still wonky.
這有點令人尷尬,但是由于我們的身份驗證仍然很糟糕,我們當(dāng)前的捐贈頁面今天已關(guān)閉。
So I've set up a PayPal page where you can make tax-deductible one-time donations to freeCodeCamp.
因此,我建立了一個PayPal頁面,您可以在其中一次性向freeCodeCamp捐款進(jìn)行免稅捐款 。
We still welcome your monthly support of freeCodeCamp. Your $5 donations each month are what makes freeCodeCamp possible, and what gives us the stable budget to plan ahead.
我們?nèi)匀粴g迎您每月對freeCodeCamp的支持。 您每個月的$ 5捐款使freeCodeCamp成為可能,并使我們有穩(wěn)定的預(yù)算來提前進(jìn)行計劃。
But if you do have a some extra cash on hand for a one-time donation, it would be a huge help.
但是,如果您確實有一筆額外的現(xiàn)金可用于一次性捐贈, 那將是巨大的幫助 。
這是我對您的承諾: (Here is my commitment to you:)
freeCodeCamp will stay free.
freeCodeCamp將保持免費。
freeCodeCamp will not run ads.
freeCodeCamp將不會投放廣告。
And when we ask you to donate, we will do so tastefully and honestly. We won't use pathos, or make those "we're going bankrupt unless you donate right now" type claims that some other nonprofits resort to.
當(dāng)我們要求您捐贈時,我們將做到高雅而誠實。 我們不會使用悲哀,也不會讓那些“除非您現(xiàn)在就捐贈,否則我們將破產(chǎn)”的類型聲稱其他一些非營利組織會采取這種行動。
Because the reality is this: Even if freeCodeCamp completely ran out of money, we would still keep going.
因為現(xiàn)實是這樣的:即使freeCodeCamp完全沒錢了,我們?nèi)匀粫^續(xù)前進(jìn)。
Yes, we would have to lay everyone off, including myself. But I would go get some other job and pay for the servers myself.
是的,我們必須解雇所有人,包括我自己。 但是我會去找其他工作,自己支付服務(wù)器費用。
Because freeCodeCamp is clearly something that the world needs.
因為freeCodeCamp顯然是世界需要的東西。
I've poured 5 years of my life into this community. I've poured $150,000 of my personal savings from my teaching career into freeCodeCamp.
我已經(jīng)為這個社區(qū)投入了5年的生命。 我從我的教學(xué)生涯中將我的個人儲蓄中的$ 150,000投入了freeCodeCamp。
freeCodeCamp will never die.
freeCodeCamp將永生。
It's just a question of how vibrantly freeCodeCamp can live.
這只是freeCodeCamp可以活得多么生動的問題。
Again, if you have some cash to spare, we are a highly efficient nonprofit, and we will put it to effective use. Donate here.
同樣,如果您有剩余的現(xiàn)金,我們將是一個高效的非營利組織,我們將充分利用它。 在這里捐款 。
And thank you again for your patience with the outage on /learn.
再次感謝您對/ learn中斷的耐心等待。
Once we've fixed all this, I will let you all know, and I'll publish my 5th anniversary article that details all the big improvements we have for our 5th anniversary.
解決所有問題后,我將通知大家,我將發(fā)表5周年紀(jì)念文章,其中詳細(xì)介紹了5周年紀(jì)念日我們?nèi)〉玫乃兄卮蟾倪M(jìn)。
Happy coding.
快樂的編碼。
翻譯自: https://www.freecodecamp.org/news/freecodecamp-servers-update-october-2019/
freecodecamp
總結(jié)
以上是生活随笔為你收集整理的freecodecamp_freeCodeCamp的服务器到底发生了什么?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 梦到两个前任预示着什么
- 下一篇: 怀孕做梦梦到死蛇好不好